You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: How to Move Schema Change from Test to Prod
3
3
author: Ayra
4
-
updated_at: 2024/09/24 18:00
4
+
updated_at: 2025/08/05 18:00
5
5
tags: Tutorial
6
6
integrations: General
7
7
category: 'Database CI/CD (GUI)'
@@ -10,41 +10,65 @@ estimated_time: '5 mins'
10
10
description: 'Learn to move schema change from test to prod.'
11
11
---
12
12
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.
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.
16
16
17
-
You have three options to move schema change from `test` to `prod` as follows.
17
+
## Option 1: Streamlined rollout (Recommended)
18
18
19
-
## Option 1: Streamlined rollout
19
+
Deploy changes to multiple environments in a single workflow:
20
20
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).
This method ensures consistent changes across environments and maintains a clear audit trail.
24
30
25
-
## Option 2: Schema Synchronization
31
+
## Option 2: Schema synchronization
26
32
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 testand need to be replicated to production:
28
34
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**.
0 commit comments