How to create a Database Lab branch
GUI​
- Go to the Database Lab instance page.
- Chose the Branches tab.
- Click the Create branch button.
- Fill the Branch name field with a meaningful name.
- (optional) Change the Parent branch and Snapshot ID if needed.
- Click the Create branch button.
- You will be redirected to the Database Lab branch page.
CLI​
Before you run any commands, install Database Lab CLI and initialize configuration. For more information, see Install and initialize Database Lab CLI.
Reference​
- Command
dblab branch
Basic branch creation​
Create a branch using dblab branch
command, specify branch name. After creation, you will switch into the new branch automatically.
$ dblab branch test
Create a branch with a different parent​
By default, created branch will be a child of the current branch. You can specify a different parent branch using --parent-branch
.
$ dblab branch --parent-branch dev test
Create a branch from a specific snapshot ID​
- List all available snapshots
$ dblab snapshot list
[
{
"id": "SNAPSHOT_ID_1",
"createdAt": "2025-04-07T20:16:57Z",
"dataStateAt": "2025-04-07T20:16:57Z",
"branch": "test",
...
},
{
"id": "SNAPSHOT_ID_2",
"createdAt": "2025-04-07T20:14:43Z",
"dataStateAt": "2025-04-07T20:14:43Z",
"branch": "test2",
...
},
...
- Create a branch, specifying the desired snapshot
$ dblab branch --snapshot-id SNAPSHOT_ID_1 test
Related​
- Guide: Delete a branch