Data Rollback

Bytebase allows taking Prior Backup before a data change is made. Bytebase stores the pre-snapshot of the affected rows, which allows you to revert that data change if needed.

The backup data is stored in your own database instance. Bytebase does not purge the backup data automatically. You can manually delete the data in bbdataarchive database/schema.

Supported Databases

DatabasePrerequisitesPrior Backup1-click Rollback
MySQLCreate a bbdataarchive database on the instance where your database is located.
PostgreSQLCreate a bbdataarchive schema on the database.
OracleCreate a bbdataarchive database on the instance where your database is located.
SQL ServerCreate a bbdataarchive database on the instance where your database is located.

Supported Operations

We are working on enabling backup and 1-click rollback for more SQL statements.

Enhanced experience

Applicable to MySQL.

Prior backup is feasible when meeting all of the following conditions:

  • The SQL statement size is less than 2M.

  • No mixed UPDATE/DELETE on the same table.

  • No mixed DDL/DML.

1-click rollback is feasible when meeting all of the following conditions:

  • The changed table has primary key.

Classic experience

Applicable to PostgreSQL, Oracle, SQL Server.

Prior backup is feasible when meeting all of the following conditions:

  • The SQL statement size is less than 2M.
  • No more than 5 statements and every statement is either UPDATE or DELETE, or all statements are UPDATE for the same table with PRIMARY KEY or UNIQUE KEY in WHERE clause.
  • No mixed DDL/DML.

Create backup

You can toggle Prior Backup switch before or after creating the issue.

bb-prior-bk-on

1-click rollback

  1. Once the change has been rolled out. You can click the Rollback button to create the rollback issue.

    bb-prior-bk-rollback

  2. The rollback issue automatically populates the rollback statements.

    bb-prior-bk-rollback-issue

Inspect the backup data

You can go to SQL Editor to inspect the backup data. If the DML change contains no more than 5 statements, then each statements will be backed up to a separate table.

bb-prior-bk-separate-table

If the DML change contains more than 5 statements, then all statements will be backed up to a single table.

bb-prior-bk-single-table-issue

bb-prior-bk-single-table

Project backup settings

This feature is available in Pro and Enterprise Plan.
  • You can enable Prior Backup by default.
  • You can control whether you want to skip backup errors and continue changing the data.

prior-backup-default

Edit this page on GitHub

Subscribe to Newsletter

By subscribing, you agree with Bytebase's Terms of Service and Privacy Policy.