Restore Database
Database Restore CD Process
The database restore format file that supported in Cloudvanti must be in .bacpac file, users can use the release pipeline to restore their database. This process main objective is to deploy the .bacpac backup file that has been uploaded in Azure Storage Account.
Users need to run this CD pipeline manually and input 2 parameters:
- BacpacFilePath, backup file path in Azure Storage Account.
- BackupBeforeRestore, set the value into True to make the pipeline to backup the database first before restoring the database or set the value into False to skip the backup process.
The backup file will store in Azure Storage, system folder. For more detail see this section.
The restore pipeline for the Staging and Production environment is different.
Staging Restore Process
Here is the restore database process in Staging.
- User create new release in <subscription-name>-DB-Restore-STG.CD pipeline. This will run the Staging DB Restore Pipeline.
- The primary database will be copied to the secondary database. (This step will be skipped if BackupBeforeRestoreis false)
- Then the secondary database will be backed up to Azure storage. (This step will be skipped if BackupBeforeRestoreis false)
- Restore the database from Azure Storage to the secondary database.
- Connecting the Staging website to the secondary database and delete the primary database.
Production Restore Process
Here is the database deployment process in Production.
- User create new release in <subscription-name>-DB-Restore-PRD.CD pipeline. This will run the Staging DB Restore Pipeline.
- The primary database will be copied to the secondary database. (This step will be skipped if BackupBeforeRestoreis false)
- Then the secondary database will be backed up to Azure storage. (This step will be skipped if BackupBeforeRestoreis false)
- Restore the database from Azure Storage to the secondary database.
- The secondary database will be connected to the deployment slot. Then the deployment slot will be warmed up. If the deployment slot website warm-up is:
- succeeded, the production and development slot will be swapped.
- failed, the secondary database will be deleted and the process CD stopped.
- After the production and development slot will be swapped, it will warming-up. If the warm-up:
- succeeded, the primary database will be deleted.
- failed, the production and development slot will be swapped again. Then the secondary database will be deleted.
For the exported database to be transactionally consistent in step 3, you must ensure either that no write activity is occurring during the export, or that you are exporting from a transactionally consistent copy of your database.
Get Backup File Path
- Make sure that you have uploaded the database in your storage account in the Azure portal, see here.
- We already provide the link to the Azure Storage location in the Wiki section in Management Portal.
- To restore database from system backup in Staging or Production, choose system folder. Choose user folder to restore from the uploaded database backup file.
- Click on the file you want to restore and copy the path.
Applying Restore
- Go to Cloudvanti Sitefinity Management Portal >> Pipelines >> Releases.
- Choose the release pipelines
Staging: <subscription-name>-DB-Restore-STG.CD.
Production: <subscription-name>-DB-Restore-PRD.CD. - Click the Create release button in top right
- Fill this form with the version that you need. For BacpacFilePath, fill it with where you put your database path before in the storage account. User can also set BackupBeforeRestore to True or False.
- Users can check and click the stage in the release history for the details of the deployment progress.
- Users can see the log of every task or check what is the error if the process failed.