Migrating from SQL CE to an existing database with Data Prefix

Topics: Administration, General, Installing Orchard
Jul 1, 2013 at 6:15 PM
I've seen the option to have a Data-Prefix so I could have many Orchard Sites on same database.

However when I originally develop I just use CE to begin with and then want to migrate to Hosting SQL. I have no option of doing Data Prefix at creation time. Is this something I can add during migration? Does the migration process involve creating the tables and data again from script and thus can add a Data Prefix?
Developer
Jul 1, 2013 at 9:03 PM
During Setup, you get to set the prefix.
Jul 2, 2013 at 12:12 PM
If by setup you mean when you initially set up your site you can't pick a Data Prefix if you are using a SQL CE.

I was hoping to add it when I migrate to a proper SQL server.
Developer
Jul 5, 2013 at 8:17 PM
A slightly inconvenient but working solution is to script out your SQL CE database (form SQL Server Management Studio) to an .sql file, then just do a search & replace on an appropriate pattern to add the prefix to all table names. Then you can use this script to script your DB into a standard SQL DB.
Jul 12, 2013 at 3:12 PM
Another option is in Webmatrix you rename your compact SQL tables with the prefix you will use and then use the migration tool into your SQL database. I ended up creating a script to do the rename since I had a number of projects to do this for.
Jul 20, 2013 at 5:56 PM
jcmervine wrote:
Another option is in Webmatrix you rename your compact SQL tables with the prefix you will use and then use the migration tool into your SQL database. I ended up creating a script to do the rename since I had a number of projects to do this for.
But I won't Orchard then look for the old SQL table names, without the prefix, is there a setting somewhere where I can say that it has a Prefix.

Also on a sidenote, what framework does Orchard use for Databases? Does it use a ORM like Entity framework?
Developer
Jul 20, 2013 at 7:38 PM
Orchard uses the Prefix set in Settings.txt.
The ORM being used is NHibernate.