Migration WebSite To an Orchard Website

Topics: Customizing Orchard
May 29, 2013 at 6:57 AM
Edited May 29, 2013 at 6:58 AM
Hi,

I develop this current website in the end of 2011, my target was to propose a website to download ebook. finally after to develop this one, I use this website as technical support to present asp.net mvc to my students associate to entity framework.

For this year, I decided according to my professional context to migrate the previous website to Orchard. I deploy the previsous website in the place below :
http://obsorchard.cloudapp.net/

I add a link to translate tin english the website.
http://translate.google.com/translate?hl=fr&sl=fr&tl=en&u=http%3A%2F%2Fobsorchard.cloudapp.net%2F

Some functionnalities doesn't work now, Facebook widget and the advert but it's not the point of my discussion.

I would like to share my functionnal needs, and I would like to be sure I don't go in the wrong way. I will push the migrate version on windows azure to show my progress.

First Step, the current
Migrate the entire model to an Orchard Module : LibraryCollection, to permit to have data in content type and part.

So my first question is :
  • A book is link to a category, an author, link(s), picture(s), comment(s), have a notation, a publication date, a publish property means enabled or disabled from Front office.
My assumption is I need to define a content type with the all properties (already used and follow the tutorials from Extending Orchard)
I need to read and use this document as support.
http://docs.orchardproject.net/Documentation/Creating-1-n-and-n-n-relations

How to migrate my current data to Orchard website?
  • Is there any tool permitting to import mass data?
  • If this tool exists, my assumption is I need to finish the module and import the data.
    public class Book
    {
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [Display(Name = "BookID")]
        [Key]
        public int BookID { get; set; }

        public String BooksTitle { get; set; }
        public String BooksTitleDisplay { get; set; }
        [UIHint("BookDescription")]
        public String BookDescription { get; set; }
        public Boolean BookPublished { get; set; }

        //[UIHint("LoudDateTime")]
        [DataType(DataType.Date)]
        public DateTime BookDateCreated { get; set; }
        //[DisplayFormat(DataFormatString = "{0:d}")]
        [DataType(DataType.Date)]
        public DateTime BookDateUpdated { get; set; }
        //[DisplayFormat(DataFormatString = "{0:d}")]                
        [UIHint("DatePublished")]
        [DataType(DataType.Date)]
        public DateTime BookDatePublished { get; set; }

        public int BookNbDownload { get; set; }

        public int CustomAverageNoteBook { get; set; }
        public int CustomNbComments { get; set; }

        public virtual BookCategorie BookCategorie { get; set; }                
        public virtual AuthorBook AuthorBook { get; set; }
        
        public virtual ICollection<BookLink> BookLinks { get; set;}                
        public virtual ICollection<BookPicture> BookPictures {get; set;}
        public virtual ICollection<BookComment> BookComments { get; set; }  
Developer
May 29, 2013 at 4:08 PM
I don't think there's a tool that will know how to map your EF entities to Orchard content items. What you could do, is write a script or program that generates a recipe containing all of your data. Alternatively, you could write a script or program in Orchard that connects to your database and leverages IContentManager directly to insert content.
May 30, 2013 at 7:03 AM
Yes I rewrite all the code, and I will generate script sql permitting to update the database.