Moving schema changes from test to production is a critical part of the database development lifecycle. Bytebase provides two primary methods to safely promote your changes across environments. This tutorial uses the sample data in our demo environment. Select Basic Project from the project selector in the upper-left to begin. Deploy changes to multiple environments in a single workflow:
  1. Navigate to CI/CD > Plans and click + New Plan.
  2. Select Schema Migration as the change type.
  3. Choose both test and prod databases as targets.
  4. Enter your SQL changes in the editor.
  5. Click Create, then Ready for Review.
  6. After checks pass, go to the Rollout tab.
  7. Click Run for each environment in sequence (test first, then prod).
This method ensures consistent changes across environments and maintains a clear audit trail.

Option 2: Schema synchronization

Use this method when changes already exist in test and need to be replicated to production:
  1. First, apply changes to the test database:
    • Navigate to CI/CD > Plans and click + New Plan.
    • Select Schema Migration and choose only the test database.
    • Enter your SQL changes and click Create.
    • Click Ready for Review, then rollout the changes.
  2. Synchronize test schema to production:
    • Navigate to Sync Schema in the left sidebar.
    • Select test as the source database.
    • Choose the desired schema version and click Next.
select-source-schema
  1. Select prod as the target database: select-target-databases-1
  2. Review the schema differences:
    • Bytebase displays a detailed diff between test (source) and prod (target).
    • Verify the changes match your expectations.
    • Click Preview issue to proceed.
    select-target-databases-2
  3. Deploy the changes:
    • Click Create to generate the synchronization issue.
    • Click Ready for Review to trigger automated checks.
    • Navigate to the Rollout tab and click Run.
The schema changes are now synchronized from test to production.

Which method to choose?

  • Streamlined rollout: Best for new changes that need to be deployed to multiple environments.
  • Schema synchronization: Ideal when test already has changes that need to be replicated to production.