Backup and restore the database

Sitefinity Cloud provides several ways to restore the project database to a desired point in time - Automated backups of the production database, automated weekly backups for development purposes and manual on-demand backups.

IMPORTANT: Sitefinity Cloud uses Azure SQL Database service. When you make a backup of your database, it will always be made using the latest stable Enterprise Edition of SQL server. Keep this in mind when considering compatibility with your local version of SQL server you are restoring the database backup to.

Automated backups

Automated backups of the production website database are made every 5 minutes. These backups are kept for a period of 35 days, enabling you to restore your website database to a desired point in time within that period. You can request a restoration to a point in time by contacting the Sitefinity support team.

NOTE: Automated backups are not made available for development purposes. They are setup for disaster recovery and emergency data restoration purposes only. If you need a database backup for development purposes refer to the Database backups for development and On-demand database backups sections further in this article. 

Database backups for development

Automated backups of the Staging and Production database are made weekly. You can access these database backups and restore them locally for development and testing purposes. For further instructions on obtaining and restoring a database backup for development follow the instructions provided in the Restore a database backup locally paragraph further in this article.

Make an on-demand database backup

A backup of the project’s database can be acquired on demand. To do this, the developer triggers a pipeline to acquire a backup. This process creates a backup of the database which is used for development and testing purposes. 

NOTE: To protect sensitive data, both the weekly database backups for development, and the on-demand database backups provide an obfuscated copy of the database. 

To get a backup of the project database follow these steps:

  1. Open the Sitefinity Cloud Management Portal
  2. Navigate to Pipelines » Releases
  3. Select the YourProjectName.DB.AcquireBackup pipeline from the list of available pipelines and click the Create release button located in the top right corner of the screen.  

  4. DBBackupReleaseTrigger

    NOTE: By default, backups will be created for all environment DBs - you can click on the environment that you want to exclude before creating the release. When you exclude an environment it appears grayed out and is populated in the Stages for a trigger change from automated to manual textbox. ExcludeEnvFromDBBackup

     

Restore a database backup locally

Database backups are stored in a dedicated storage account that you can access. To restore a database backup on your local machine follow these steps:

  1. Install Azure Storage Explorer.
  2. Login with your Sitefinity Cloud Management Portal (Azure DevOps) account.
  3. Browse the blob storage account named after the website you’re working on.
  4. Expand the Blob Containers item and select db-backups
  5. Locate the folder containing database backup for the desired environment.
    AzureStrgExplorerDBBUsFolders
  6. Expand the folder and download the desired  .backpac file(s)
  7. Import the .backpac file in your local environment SQL server

Restore the database from Production to Staging environment

The Staging and Production environments have been isolated to create a safe mechanism for deploying and testing code changes, while content editing on the production environment remains uninterrupted. The two environments use separate databases. In order to have a copy of the latest Production database restored on Staging for testing or upgrade purposes follow these steps:

  1. Open the Sitefinity Cloud Management Portal for your project.
  2. Navigate to Pipelines » Releases
    1. Select the YourProjectName.DB.RestoreFromProduction pipeline from the list of available pipelines and click the Create release button located in the top right corner of the screen.  DBBackupReleaseTrigger

NOTE: If you have more than one staging environments configured, by default, the DB will be restored on all of them. You can click on the staging environment that you want to exclude before creating the release

Was this article helpful?