Switch content database

From Kooboo document
Jump to: navigation, search

MSSQL, RavenDB, MongoDB

By default, Kooboo CMS runs on XML based data storage; it is suitable for websites with limited content, for example a small business website. For larger websites, you should consider using other content providers; we have provided support for MSSQL, SQLCE, RavenDB and MongDB.

Download the content_provider.zip from kooboo.codeplex.com. Unzip it you should see the following folders and files.

Content provider folder.png

Export and import sites

before you do the migration, first you need to export the site. After you finish the migration, you can remove the old site and do an import.

How to use another content provider.

To use another content provider, copy all the files in the content provider folder into kooboo CMS bin folder. For example, to use SQLCE, copy all files in above screen into Kooboo bin folder if you are using the default XML based content provider. .

If you are already using a content provider except the default XML based provider, you must first remove that content provider by removing all related dlls, the most important is the Kooboo.CMS.Content.Persistence.{providername}.dll


Trust level and database server installation

SQLCE and RavenDB might require to run under full trust level. MongoDB and RavenDB client server mode requires manully install of the server instance.

Configuration file for each content provider

For SQLServer, RavenDB, MongoDB, you can find a .config inside each folder, you may copy that config file to the web bin folder of Kooboo cms and correct the config values. If you did not do that, a config file will also be generated the first time you run the application using new content provider. You can modify the values after it is generated, web server may restart to load the new values,

The configuration files contains the following settings.

SQLServer

SharingDatabase: Whether all content repository share one database or each content repository has its own database. Connections: To store multiple connection string for each database in the individual database mode. Name value is the content database name. SharingDatabaseConnectionString: In case that it uses the SharingDatabase, this is the connection string. CreateDatabaseSetting: In case that each content repository has its own database, this is the connection string that will be used to create each database.

So you either define the value in the SharingDatabaseConnectionString or in the CreateDatabaseSetting

SQLCe does not have configuration settings. Kooboo saves all db files under a data folder.

MongoDB

ConnectionString: MongoDB connection string, default is: mongodb://localhost SharingDatabase: All content repository share the same database or each has its own database. Default is false. .

RavenDB

Due to lack support of C# dynamic type, Kooboo only supports RavenDB from version RavenDB-Unstable-Build-283. Previous version of RavenDB is not supported.

RavenDB provides two modes, embed or client server mode. The embed mode store all content database under the kooboo CMS data folder.

The server mode works pretty differently from mongodb. By default, all content database share one RavenDB connection/database, you can assign different RavenDB database for each content database using the Connections section

DefaultConnection: This is the default connection used by all content database. Connections: Define RavenDB database connection to be used by one or more kooboo content database.