Skip to main content

How to create a database branch

info

DBLab Engine must be version 4.0 or higher.

GUI​

  1. Go to the Database Lab instance page.
  2. Choose the Branches tab. Database Lab instance page / Create branch
  3. Click the Create branch button. Database Lab instance page / Create branch
  4. Fill the Branch name field with a meaningful name.
  5. (optional) Change the Parent branch and Snapshot ID if needed.
  6. Click the Create branch button.
    Database Lab instance page / Create branch
  7. You will be redirected to the Database Lab branch page. Database Lab instance page / Create branch

CLI​

Before you run any commands, install Database Lab CLI and initialize configuration. For more information, see Install and initialize Database Lab CLI.

Reference​

Basic branch creation​

Create a database branch using the dblab branch command and specify the branch name; after creation, you will switch into the new branch automatically:

$ dblab branch test

Create a database branch with a different parent​

By default, the 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 database branch from a specific snapshot ID​

  1. 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",
...
},
...
  1. Create a database branch specifying the desired snapshot:
$ dblab branch --snapshot-id SNAPSHOT_ID_1 test