|
2 | 2 | title: Upgrade |
3 | 3 | --- |
4 | 4 |
|
5 | | -import TerminalDockerRunVolume from '/snippets/install/terminal-docker-run-volume.mdx'; |
| 5 | +## Upgrade Process |
6 | 6 |
|
7 | | -<Warning> |
8 | | -**BEFORE YOU UPGRADE** |
| 7 | +The following example demonstrates upgrading Bytebase using Docker. **Follow these steps in the exact order to ensure a safe upgrade:** |
| 8 | + |
| 9 | +### Step 1: Stop and Remove the Current Container |
| 10 | + |
| 11 | +To prevent database corruption, ensure only one Bytebase instance accesses the metadata at a time: |
9 | 12 |
|
10 | | -- Never run multiple containers on the same data directory. Stop and remove the old one first to avoid corruption. |
11 | | -- Back up your metadata before upgrading. You’ll need it if you ever downgrade. |
12 | | -- Verify the upgrade in a test environment first. |
| 13 | + ```text |
| 14 | + docker stop bytebase |
| 15 | + docker rm bytebase |
| 16 | + ``` |
13 | 17 |
|
| 18 | +### Step 2: Create a Metadata Backup |
| 19 | + |
| 20 | +🚨 **Critical:** Always create a backup of your metadata before upgrading. This backup is essential if you need to rollback to a previous version. See the "Back up Data" section below for detailed instructions. |
| 21 | + |
| 22 | +### Step 3: Deploy the New Version |
| 23 | + |
| 24 | +Launch Bytebase with the updated version using the appropriate Docker run command for your setup. |
| 25 | + |
| 26 | +<Warning> |
| 27 | +**Best Practice:** Always test the upgrade process in a staging environment before applying it to production. |
14 | 28 | </Warning> |
15 | 29 |
|
16 | 30 | ## Back up Data |
@@ -109,31 +123,3 @@ You should periodically back up the entire [`--data`](/reference/command-line#-- |
109 | 123 | If Bytebase is running and not in the [`--readonly`](/reference/command-line#--readonly) mode, and you want to take the backup, then the underlying data volume must support snapshot feature where the entire directory can take a snapshot at the same time, otherwise it may produce a corrupted backup bundle. |
110 | 124 |
|
111 | 125 | </Note> |
112 | | - |
113 | | -## Upgrade Process |
114 | | - |
115 | | -Take Docker as an example (**follow the below steps exactly**): |
116 | | - |
117 | | -1. Stop Bytebase |
118 | | - |
119 | | - ```text |
120 | | - docker stop bytebase |
121 | | - docker rm bytebase |
122 | | - ``` |
123 | | - |
124 | | -1. 🚨 Back up the Bytebase metadata |
125 | | - |
126 | | - ```bash |
127 | | - cp -rp ~/.bytebase/data ~/.bytebase/data.bak |
128 | | - ``` |
129 | | - |
130 | | - Above example backs up the metadata stored in the embedded database. |
131 | | - If you store metadata in the [external PostgreSQL](/get-started/self-host/external-postgres/), you should |
132 | | - back up that database using the instructions in the "Back up Data" section above. |
133 | | - |
134 | | -1. Change version string to 3.9.0 |
135 | | - |
136 | | -1. Start Bytebase |
137 | | - |
138 | | - <TerminalDockerRunVolume /> |
139 | | - |
0 commit comments