Loading...
Area: Optimizely CMS

Recommended reading 

EPiServer uses Microsoft SQL Server to store content and other information that is created in the system, all database editions including SQL Azure are supported. See the system requirements for details on which specific versions of SQL Server that are supported.

Setting up the database [New in 8.8.0]

The database is automatically created with the EPiServer schema when creating new sites from the Visual Studio integration. Each version of the database schema targets a specific version of the product. See Deployment Scenarios for how to deploy a database from development to production.

To install an empty database schema the SQL files can be found in the NuGet package EPiServer.CMS.Core in the tools subfolder. There is also a cmdlet Initialize-EPiDatabase that you can run from the Package Manager Console in the Visual Studio. The  Initialize-EPiDatabase cmdlet installs all database schemas that are included in the installed NuGet packages (both CMS and Commerce). The cmdlet is available as of version 8.8.0.

If the web application has been configured to use Microsoft Windows Workflow Foundation or the classic Microsoft ASP.NET SQL Membership provider module you need to deploy these database schemas manually, the Initialize-EPiDatabase cmdlet does not install them since they are not used by default. See Activating Workflows for more details on installing the schema for the workflow system and aspnet_regsql for setting up the classic ASP.NET schema.

Recommendations

To make it possible to upgrade EPiServer CMS, you should never directly access the tables or stored procedures in the database, or create custom tables that interfer with the tables created by EPiServer CMS. It is recommended to always use the documented API instead, since no backwards compatibilty on the database level is guaranteed.

For availability and performance of the database, EPiServer CMS supports several SQL Server high-availability options, these include fail-over clustering and database mirroring. For instance, database mirroring is used to retrieve a “hot” standby database that operates in read-only mode, and all transactions are copied to the mirror, either synchronously or asynchronously. Instant fail-over can be configured using a “witness” server.

When running a SQL Server in production we recommend that a maintenance plan is created for the database including backup, checking database consistency and rebuilding indexes. Performance of the database will degrade over time if no maintenance plans is created, especially if indexes are never rebuilt the query speed will degrade as new content is added.

See also

Do you find this information helpful? Please log in to provide feedback.

Last updated: Jun 01, 2015

Recommended reading