Database Rollback is the process of reverting database changes to an older version. Rollback the database will restore past database data that has been deployed to your website. Database Rollback needs to be done for a variety of reasons, such as failed deployment or unacceptable website condition that might be caused by the database. This can be done in Azure DevOps manually.
Rollback Restore DB
To rollback database to the previous version must use DB-Restore pipeline. Doing rollback database using DB-Deploy pipeline will only execute the previous SQL script.
Here’s how to do it.
- In Pipeline >> Releases there is option for rollback database
<subscription-name>-DB-Restore-STG.CD for rollback database in Staging.
<subscription-name>-DB-Restore-PRD.CD for rollback database in Production.
- Select which database that you want to rollback. For example, we select rollback Staging database as shown in the following image.
- Click the database release.
- Put your cursor in the stage box and click redeploy.
- Wait until your deployment success and it’s done.
After the database is restored, the database schema and data will be replaced by the previous database version.