Migrating Data

Posted by Community Admin on 03-Aug-2018 18:49

Migrating Data

All Replies

Posted by Community Admin on 15-Jan-2012 00:00

We are in the process of migrating to 4.4 of Sitefinity.  However, since we have been users for so long and developed so much stuff custom, our site has become redundant with some of the newer features (like the Module Builder, etc.).  So, we are taking a "scorched earth" approach and starting over.  However, we have a lot of images, documents and generic content that we really would like to migrate over.  Is there any "simple" way to do this?  We have upgraded (in our test environment), the current site so the database should be at the 4.4 structure.  Ideally, we could run stored procedures and simply copy data, but I am sure the "real" solution involves API coding.  At any rate, I would like to keep it as simple as possible.  Thanks for any suggestions.

Posted by Community Admin on 15-Jan-2012 00:00

Allen,

Have you looked at the migration module? You can migrate only specific parts of the old site, including just the Generic Content, Images and Documents.

this, however, will recreate the items in the new 4.4 site with that new database structure and architecture. It is not recommended that you attempt to do this directly at the database level as it is not supported in any way.

This should hopefully take care of migrating all of your libraries automatically. And if you do need more control over the migraion, indeed the API is the way to go.

Give the migration module a try, and let me know if you have any issues, or if you want to try something different with the API.

hope this is helpful!

Posted by Community Admin on 17-Jan-2012 00:00

The problem is that I don't have a 3.7 site.  Instead, I have a site that started in 3.0 and migrated along all the way to 4.0 (well, I have actually now upgraded it to 4.4).  However, now that the module builder is built in, we would like to "clean out" as much custom coding as the module builder will allow, but we want to keep our core data (images, content, documents, etc.)  Yes, I could simply delete the custom stuff, but there would be orphaned database items and that isn't very clean.  Also, we could simply, manually copy everything into a blank site, but we literally have 1000s of items and that isn't a task anyone is looking forward to.  I was just trying to find out if there were any way to do it (even via code) to maybe script a migration.  If the migration tool weren't just for 3.7, it would be perfect, as it allows me to select items to migrate.  

FYI - Just for kicks, I did try to see if it would work with the "old" website, but it wouldn't let me log in. :(

Posted by Community Admin on 17-Jan-2012 00:00

ohhh okay I think I get you now!

So you're already running Sitefinity 4.4, but you have a lot of custom modules that you developed that you would instead like to host within the new module builder. Am I understanding that more correctly now?

If that is the case, each module builder that you create automatically generates a code reference with API examples for writing data to the module. You can certainly associate existing content items like images and documents by creating the associated fields in the module then using the API to save the item to the field.

Depending on how you have your existing modules setup there will be different approaches but I think it could certainly be done. The module builder APIs let you basically anything.

Take a look at the code references and let me know what you think. If you can tell me more about what you're trying to accomplish specifically (such as a specific module, fields, and how you currently store the content) I can do my best to get you migrated over.

hope this is helpful!

Posted by Community Admin on 17-Jan-2012 00:00

I don't think I am quite making myself clear.  I will try again.  

We have an existing site that has been extended for several years.  While it has currently been upgraded (in dev) to 4.4, we want to take full advantage of the module builder.  We have even experimented with the module builder and feel very comfortable with it.  However, due to the site's evolution over the years, we essentially want to start "from scratch" with a brand new project extending as much as possible with the module builder.  In fact we already have a brand new site about 50% complete in functionality and visual design.  The thing that is missing is a way to take all our existing generic content, blogs, libraries, and images from the OLD site and migrate them to the NEW site.  True, we could simply save it all out and manually copy or recreate it in the new site, but my goal was to find a way to save us all that work.

Again, the migration tool looks like it would be perfect if it were available in other migration versions (e.g. 4 to 4.4, old URL to new URL, etc.), but it is not.  So, in lieu of that, I was wondering if there is any other way to do that (e.g. code scripts, SQL scripts etc.)  I could open a support ticket, but I thought I would check with the community first.

So, again...any ideas?  Has anyone else tried something like this?  Is there an "open-source version" of the migration tool so I could modify it to suit our need?

Posted by Community Admin on 17-Jan-2012 00:00

oh okay I think I'm starting to get you now. the migration tool is definitely designed for moving from 3.7 to the latest version (currently 4.4)

however you do indeed have options available for you that should help you accomplish what you need. perhaps not automatically but certainly in way to help you reduce the work involved.

The simplest thing to do would be to use an additional provider for these content items, pointing them at your existing database. this will allow you to feed those items directly into the new site from an alternate provider.

If you don't want the overhead of working with a separate database, you could then use the Sitefinity API to copy items directly from one provider to the default one, then remove the alternate provider when everything is copied.

the Sitefinity documentation should help you with this. you simply need two instances of the content managers (one for each provider) and run through the various methods (GET on the old and CREATE/SAVE on the other) to copy the items over.

There is a content manager for each of the modules to help you copy them over.

I hope that I have now understood your situation and that you find this info useful. If I'm still not getting it (sorry!) please let me know and I'll continue to do my best to help!

Posted by Community Admin on 17-Jan-2012 00:00

Hmmmm...I didn't think of the alternative content provider.  That's an interesting idea.  However, I would use it as a way to have access to all the data (in a single site) so I could move parts of it to a single database using the API. 

For some reason, not really sure why, I was hung up on the fact that the content was in two different sites with us wanting to keep partial content from each.  I wasn't sure how I would use the API to connect to a "different" site so could have a source and destination, but the multiple content providers ideas seems to remove that obstacle.   Thanks for that tidbit.

Of course, I am lazy and wish there were an even easier way to do it, but this should be much better than manually copying everything.   :)

This thread is closed