Skip to content

Commit fcb1359

Browse files
adela-bytebasetianzhouCopilot
authored
docs: update sync test to prod tut (#805)
* update how to sync test to prod * update * Update mintlify/tutorials/how-to-move-schema-change-from-test-to-prod.mdx Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Tianzhou <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent ae4c8c5 commit fcb1359

File tree

4 files changed

+44
-20
lines changed

4 files changed

+44
-20
lines changed
Binary file not shown.
Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: How to Move Schema Change from Test to Prod
33
author: Ayra
4-
updated_at: 2024/09/24 18:00
4+
updated_at: 2025/08/05 18:00
55
tags: Tutorial
66
integrations: General
77
category: 'Database CI/CD (GUI)'
@@ -10,41 +10,65 @@ estimated_time: '5 mins'
1010
description: 'Learn to move schema change from test to prod.'
1111
---
1212

13-
We're demonstrating this process using our sample [demo](https://demo.bytebase.com/) data in the Basic Project. **Select Project** on the upper-left where you choose `Basic Project`. Now you can operate within the project.
13+
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.
1414

15-
![basic-project](/content/docs/tutorials/how-to-move-schema-change-from-test-to-prod/basic-project.webp)
15+
This tutorial uses the sample data in our [demo environment](https://demo.bytebase.com/). Select **Basic Project** from the project selector in the upper-left to begin.
1616

17-
You have three options to move schema change from `test` to `prod` as follows.
17+
## Option 1: Streamlined rollout (Recommended)
1818

19-
## Option 1: Streamlined rollout
19+
Deploy changes to multiple environments in a single workflow:
2020

21-
Go to **Database** -> **Databases** section on the left-side bar. Select both databases to **Edit Schema**, where you type in raw SQL code in the code block and click **Create**. Checks will automatically run and then you can **Approve** the change and **Rollout**.
21+
1. Navigate to **CI/CD > Plans** and click **+ New Plan**.
22+
2. Select **Schema Migration** as the change type.
23+
3. Choose both `test` and `prod` databases as targets.
24+
4. Enter your SQL changes in the editor.
25+
5. Click **Create**, then **Ready for Review**.
26+
6. After checks pass, go to the **Rollout** tab.
27+
7. Click **Run** for each environment in sequence (test first, then prod).
2228

23-
![streamlined-rollout](/content/docs/tutorials/how-to-move-schema-change-from-test-to-prod/streamlined-rollout.webp)
29+
This method ensures consistent changes across environments and maintains a clear audit trail.
2430

25-
## Option 2: Schema Synchronization
31+
## Option 2: Schema synchronization
2632

27-
Also within **Database** -> **Databases** section on the left-side bar in `Basic Project` interface, select only `test` database to **Edit Schema**. Create, Approve and Rollout like we did to the two databases in Option 1.
33+
Use this method when changes already exist in test and need to be replicated to production:
2834

29-
Then enter [**Sync Schema**](/change-database/synchronize-schema/) on the left-side bar. Select `test` in **Database** to refer to, and choose a **Schema version**. Click **Next**.
35+
1. First, apply changes to the test database:
36+
- Navigate to **CI/CD > Plans** and click **+ New Plan**.
37+
- Select **Schema Migration** and choose only the `test` database.
38+
- Enter your SQL changes and click **Create**.
39+
- Click **Ready for Review**, then rollout the changes.
40+
41+
2. Synchronize test schema to production:
42+
- Navigate to **Sync Schema** in the left sidebar.
43+
- Select `test` as the source database.
44+
- Choose the desired schema version and click **Next**.
3045

3146
![select-source-schema](/content/docs/tutorials/how-to-move-schema-change-from-test-to-prod/select-source-schema.webp)
3247

33-
Select `prod` as target database.
48+
3. Select `prod` as the target database:
49+
50+
![select-target-databases-1](/content/docs/tutorials/how-to-move-schema-change-from-test-to-prod/select-target-databases-1.webp)
3451

35-
![select-target-databases-1](/content/docs/tutorials/how-to-move-schema-change-from-test-to-prod/select-target-databases-1.webp)
52+
4. Review the schema differences:
53+
- Bytebase displays a detailed diff between test (source) and prod (target).
54+
- Verify the changes match your expectations.
55+
- Click **Preview issue** to proceed.
3656

37-
You can see how Bytebase shows the diff between the test database (source) and the prod database (target). **Preview issue** to deploy the difference
57+
![select-target-databases-2](/content/docs/tutorials/how-to-move-schema-change-from-test-to-prod/select-target-databases-2.webp)
3858

39-
![select-target-databases-2](/content/docs/tutorials/how-to-move-schema-change-from-test-to-prod/select-target-databases-2.webp)
59+
5. Deploy the changes:
60+
- Click **Create** to generate the synchronization issue.
61+
- Click **Ready for Review** to trigger automated checks.
62+
- Navigate to the **Rollout** tab and click **Run**.
4063

41-
**Create** this issue, approve and deploy as we did before.
64+
The schema changes are now synchronized from test to production.
4265

43-
![select-target-databases-3](/content/docs/tutorials/how-to-move-schema-change-from-test-to-prod/select-target-databases-3.webp)
66+
## Which method to choose?
4467

45-
Thus we have successfully propagate the change from `test` to `prod`.
68+
- **Streamlined rollout**: Best for new changes that need to be deployed to multiple environments.
69+
- **Schema synchronization**: Ideal when test already has changes that need to be replicated to production.
4670

47-
## Related docs
71+
## Related documentation
4872

49-
- [Streamlined Rollout](/change-database/batch-change/#change-databases-from-multiple-environments)
50-
- [Schema Synchronization](/change-database/synchronize-schema)
73+
- [Batch Changes Across Environments](/change-database/batch-change/#change-databases-from-multiple-environments)
74+
- [Schema Synchronization Guide](/change-database/synchronize-schema)

0 commit comments

Comments
 (0)