Deploy database schema changes

Overview

Your Sitefinity Cloud website is configured in a Continuous Delivery (CD) setup according to best practices for web development. In a CD setup, the state of the application is part of the deployment package. This way, when you make a deployment, the package contains the changes and modifies the environment automatically. When your development team works on your website in the local development environment, this usually results in code and database changes that must be promoted to the next environment. This article provides information about the process for deploying database schema changes form your local development environment to Sitefinity Cloud environments.
For information about deploying code changes, see Deploy code changes.

To promote database schema changes of your Sitefinity Cloud website from the local development environment to a Sitefinity Cloud environment, you must leverage the Export for deployment option of the export/import mechanisms of Sitefinity CMS. For more information, see Export and deploy database changes.

NOTE: Export for deployment only exports the database schema (structural) changes. It cannot be used as a content promotion mechanism. In case you want to transfer content between environments, refer to Transfer content between environments

Use Export for deployment to improve developer collaboration

The Export for deployment mechanism enables you to export all database schema changes in a specific format on the file system. The exported files can then be added to your solution and committed under source control.

NOTE: The Deployment folder is not included in the Visual Studio project by default. To promote the changes to the next environment, you must explicitly include the folder in your project. 

Every time Sitefinity starts, it checks the ~/App_Data/Sitefinity/Deployment folder and applies any changes detected there. This way, all members of your development team can collaborate by committing their database schema changes to source control, which helps with merging changes and resolving conflicts, and ensure they are all working with the same schema locally.

Promote database schema changes to Sitefinity Cloud environments

After you have used Export for deployment to generate the database export files and have committed them to source code, the files automatically become part of the deployment package. Once the package is deployed to a Sitefinity Cloud environment, Sitefinity will detect the changes and apply them on startup. This makes the source code the single source of truth when it comes to the database schema and ensures consistency across the environments. 

Was this article helpful?