Maintaining data integrity between local and server orchard Compact SQL databases

Topics: Administration, Customizing Orchard
Mar 5, 2013 at 10:30 AM
I am new to the Orchard CMS and just used Web Matrix to publish my site to a server using FTP.

My question concerns the maintenance of data integrity in the Compact SQL.

If I modify my local site by, for example, loading and configuring modules, widgets and pages and then go to publish the site using webmatrix to update the server version what happens to the data (i.e new user registrations) on the server Compact SQL? Will all the server data get overwritten?

What procedure should I follow to make sure the changes on the local and server database are combined and maintained?
Mar 7, 2013 at 12:35 AM
Yes, if you upload your SQL CE database file, it will overwrite the server version, so you will automatically lose all data that was in there, since the file is overwritten.

In Orchard, we implement classes called Migrations. Once your site is live, and you need to create new tables or do something else that touches the database schema, you will create a new migration step.

When you upload your new version of your module, Orchard will execute the added migration step.

Another approach is to stop your site (or point it to an Under Construction page), download the server DB, apply changes, then upload.
If you are concerned about content, you could create and update content on the server, and download the server DB every time you want to work with the production DB.

In the end, always make sure you backup production databases and other user generated files.
Apr 30, 2013 at 9:55 PM
After searching this forum for a similar reason, I would like to point out that this thread https://orchard.codeplex.com/discussions/262698 is very similar and provides at least a partial solution/workaround.

As for adding modules, they normally work ok by simply copying the files over, and then going to "enable". Yes you have to configure them both places. But for your newly added/changed content, you can handle this by exporting from dev and importing to live, via the Import Export module.

By the combination of these methods and sfmskywalker's post above, we can approximate a reasonable deployment methodology, until Orchard gets a little more feature mature.