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.

  1. 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.
  2. Select which database that you want to rollback. For example, we select rollback Staging database as shown in the following image.

  3. Click the database release.

  4. Put your cursor in the stage box and click redeploy.

  5. 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.