How to move from SqlCe to SqlExpress

Topics: General, Installing Orchard, Writing modules
Jan 21, 2012 at 2:01 PM
Edited Jan 21, 2012 at 2:02 PM

I have started developing a module using the default Sqlce configuration that I chose when installing Orchard.

I created a Migration class for my data and this updated the CE db.

Now I would like to change database to a SQLServer instance (in this case it's SQL Express but could as easily be 2008).

How do I change the database and migrate the orchard data and my module "schema" data? Is it possible without reinstalling Orchard? I thought it might be as easy as changing the connection strings and running a magic command to recreate the new db instance. 

Jan 21, 2012 at 2:34 PM

The easiest way in my opinion is to open the website in WebMatrix.

Once the Orchard Website is opened in WebMatrix you can then choose the "Databases" tab and see the Orchard Database, "Orchard.sdf". Click on the database to select it and then the "Migrate" menu option will be enabled. Click "Migrate" and follow the instructions to upgrade the database to SQL Server Express or SQL Server. The connectionstring will be updated during the upgrade so you should be ready to go.

I've rarely had a problem during an upgrade, but it is always wise to backup the database before the migration.



Jan 21, 2012 at 2:53 PM

Excellent. Thanks Dave. I never knew that about WebMatrix.