开发者

How do I change the database provider in Orchard?

开发者 https://www.devze.com 2023-02-04 08:02 出处:网络
After doing a test install of Orchard 1.0, I\'ve decided I want to use regular SQL Server instead of SQLCE. How do I change the provider? And, how do I re-run the database set开发者_运维百科up?Best th

After doing a test install of Orchard 1.0, I've decided I want to use regular SQL Server instead of SQLCE. How do I change the provider? And, how do I re-run the database set开发者_运维百科up?


Best thing to do is to delete all files from under your App_Data folder in Orchard.Web, this way you can start fresh :)


Edit app_data\default\settings.txt.


You should change the settings.txt, located in App_Data\Sites\Default.

In this file, the connectionstring and provider is stored as plain text, like so:

Name: Default
DataProvider: SqlServer
DataConnectionString: Data Source=server;Initial Catalog=dbname;User Id=username;Password=password;

If you are using the SqlCe DataProvider, the connectionstring will be null. Change it to the appropriate connectionstring and change the DataProvider to SqlServer. Once this is changed correctly, you'll be able to use the supplied SQL Server.

To migrate the data from SQL CE, I've used this VS2010 plugin as you can't connect to those DB's yet out of the box: http://visualstudiogallery.msdn.microsoft.com/0e313dfd-be80-4afb-b5e9-6e74d369f7a1/

Hope it'll be of any use to you as deleting the App_Data folder will give you a lot more work.

0

精彩评论

暂无评论...
验证码 换一张
取 消