หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
A snapshot is a point-in-time capture of a project's root branch, including the schema and all data. Lakebase creates snapshots instantly with minimal performance impact. Use them as a backup or restore point.
You can create, restore, and manage snapshots in the Lakebase App, or work with them programmatically using the snapshots API from the Python SDK, Java SDK, Databricks CLI, or curl. Terraform can restore from a snapshot by creating a branch. Where an operation is available more than one way, the instructions are shown together as tabs.
Note
Starting June 1, 2026, snapshot storage is billable for Lakebase. See Snapshot storage costs.
When to use snapshots
Snapshots are useful for regular backups or before making schema changes or other potentially destructive operations. They provide a quick way to create restore points that you can restore from if needed.
Create snapshots manually
Snapshots capture the state of your branch at a point in time. You can create snapshots manually on root branches only. Manual snapshots are limited to 10 per project (see Project limits). You can restore to these snapshots from any branch in your project.
Create a snapshot
Snapshots are created instantly and are useful before making significant changes to your schema or data.
UI
Go to your project in the Lakebase App and select Backup & Restore in the branch navigation. Click Create snapshot to capture the current state of your data.

Python SDK
create_snapshot returns a long-running operation. Call .wait() to block until the snapshot is available. The result is the Snapshot. source_branch is required, and so is an expiration: set exactly one of ttl, expire_time, or no_expiry. Optionally pin a point in time with source_branch_lsn or source_branch_time.
from databricks.sdk import WorkspaceClient
from databricks.sdk.service.postgres import Snapshot, SnapshotSpec, Duration
w = WorkspaceClient()
snapshot = Snapshot(
spec=SnapshotSpec(
source_branch="projects/my-project/branches/main",
ttl=Duration(seconds=604800), # 7 days
)
)
result = w.postgres.create_snapshot(
parent="projects/my-project",
snapshot=snapshot,
snapshot_id="my-snapshot",
).wait()
print(f"Snapshot created: {result.name}")
Java SDK
import com.databricks.sdk.WorkspaceClient;
import com.databricks.sdk.service.postgres.*;
import com.google.protobuf.Duration;
WorkspaceClient w = new WorkspaceClient();
SnapshotSpec spec = new SnapshotSpec()
.setSourceBranch("projects/my-project/branches/main")
.setTtl(Duration.newBuilder().setSeconds(604800L).build()); // 7 days
Snapshot snapshot = new Snapshot().setSpec(spec);
Snapshot result = w.postgres().createSnapshot(
new CreateSnapshotRequest()
.setParent("projects/my-project")
.setSnapshot(snapshot)
.setSnapshotId("my-snapshot")
).waitForCompletion();
System.out.println("Snapshot created: " + result.getName());
CLI
The snapshot_id is a positional argument after the project. The spec maps to the --json body:
databricks postgres create-snapshot projects/my-project my-snapshot \
--json '{
"spec": {
"source_branch": "projects/my-project/branches/main",
"ttl": "604800s"
}
}'
curl
Creating a snapshot is a long-running operation. The request returns an operation that you poll until it completes. The completed operation unpacks to the Snapshot resource. In practice the snapshot becomes AVAILABLE promptly.
The snapshot spec requires a source_branch. Configure the point in time and expiration as follows:
- Point in time (optional): set either
source_branch_lsnorsource_branch_time(mutually exclusive). Omit both to snapshot the current head of the branch. - Expiration (required): set exactly one of
expire_time(an RFC 3339 timestamp that must be in the future),ttl(a duration in seconds, such as"604800s"), orno_expiry: true.
The snapshot_id is required, is chosen by you, and cannot be changed after creation.
Send the create request. The
snapshot_idgoes in the query string, and the spec maps to the request body:curl -X POST "$WORKSPACE/api/2.0/postgres/projects/my-project/snapshots?snapshot_id=my-snapshot" \ -H "Authorization: Bearer ${DATABRICKS_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "spec": { "source_branch": "projects/my-project/branches/main", "source_branch_lsn": "16/B374D848", "ttl": "604800s" } }'The response is a long-running operation:
{ "name": "projects/my-project/operations/<operation-id>", "done": false }Poll the operation until
doneistrue:curl "$WORKSPACE/api/2.0/postgres/projects/my-project/operations/<operation-id>" \ -H "Authorization: Bearer ${DATABRICKS_TOKEN}" | jqWhen complete, the operation's
responseunpacks to theSnapshot:{ "name": "projects/my-project/operations/<operation-id>", "done": true, "response": { "@type": "type.googleapis.com/databricks.postgres.v1.Snapshot", "name": "projects/my-project/snapshots/my-snapshot", "status": { "full_size_bytes": "10485760", "diff_size_bytes": "524288" } } }Size fields are
int64values serialized as strings.Confirm the snapshot is available by getting it directly.
For more information about long-running operations, see Long-running operations.
Create a backup schedule
Schedule automated snapshots to run at regular intervals (daily, weekly, or monthly) to ensure consistent backups without manual intervention. Backup schedules are configured per branch and only apply to root branches. The limit on manual snapshots (see Project limits) does not apply to scheduled snapshots.
To create or modify a backup schedule:
From the Backup & Restore page in your project, click Edit schedule to open the backup schedule configuration dialog.

Select a schedule frequency from the following options:
- No schedule – Disables automated snapshots (default)
- Daily – Creates a snapshot every day at a specified time
- Weekly – Creates a snapshot on a specific day of the week
- Monthly – Creates a snapshot on a specific day of the month

Configure the schedule details based on your selected frequency. Specify how often you want to create snapshots and how long to keep them.
Once configured, snapshots created by the schedule appear on the Backup & Restore page with a label indicating they were created automatically.
Snapshot retention
Snapshots are automatically deleted after their retention period expires. You can adjust retention settings at any time by editing the schedule. Keep in mind:
- Shorter retention periods help manage how many scheduled snapshots are retained.
- Deleted snapshots can't be recovered
- Manual snapshots aren't affected by backup schedule retention settings
Get and list snapshots
View your snapshots on the Backup & Restore page in the Lakebase App, or retrieve them programmatically with the API.
List snapshots
UI
On the Backup & Restore page in the Lakebase App, your snapshots are listed by date, showing each snapshot's date and size. Scheduled snapshots appear in the same list with a label indicating they were created automatically.
Python SDK
from databricks.sdk import WorkspaceClient
w = WorkspaceClient()
for snapshot in w.postgres.list_snapshots(parent="projects/my-project"):
print(f"Snapshot: {snapshot.name}")
Java SDK
import com.databricks.sdk.WorkspaceClient;
import com.databricks.sdk.service.postgres.Snapshot;
WorkspaceClient w = new WorkspaceClient();
for (Snapshot snapshot : w.postgres().listSnapshots("projects/my-project")) {
System.out.println("Snapshot: " + snapshot.getName());
}
CLI
databricks postgres list-snapshots projects/my-project --output json | jq
curl
List the snapshots in a project. Use page_size and page_token to page through results. An empty next_page_token indicates the last page:
curl "$WORKSPACE/api/2.0/postgres/projects/my-project/snapshots?page_size=20" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}" | jq
{
"snapshots": [{ "name": "projects/my-project/snapshots/my-snapshot" }],
"next_page_token": ""
}
Get a single snapshot
Fetch one snapshot's details by its ID. Unlike create and delete, get returns the Snapshot resource directly (it is not a long-running operation). On reads, expiration is reported as either expire_time or no_expiry.
Python SDK
from databricks.sdk import WorkspaceClient
w = WorkspaceClient()
snapshot = w.postgres.get_snapshot(name="projects/my-project/snapshots/my-snapshot")
print(f"Snapshot: {snapshot.name}")
print(f"Source branch: {snapshot.status.source_branch}")
print(f"Full size: {snapshot.status.full_size_bytes} bytes")
Java SDK
import com.databricks.sdk.WorkspaceClient;
import com.databricks.sdk.service.postgres.Snapshot;
WorkspaceClient w = new WorkspaceClient();
Snapshot snapshot = w.postgres().getSnapshot("projects/my-project/snapshots/my-snapshot");
System.out.println("Snapshot: " + snapshot.getName());
System.out.println("Full size: " + snapshot.getStatus().getFullSizeBytes() + " bytes");
CLI
databricks postgres get-snapshot projects/my-project/snapshots/my-snapshot --output json | jq
curl
curl "$WORKSPACE/api/2.0/postgres/projects/my-project/snapshots/my-snapshot" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}" | jq
Restore from a snapshot
To use a snapshot, restore it by creating a new branch from it. There is no in-place restore: your current branch is left unchanged, and a new root branch is created with the snapshot data.
UI
On the Backup & Restore page in the Lakebase App, snapshots are listed by date. Find the snapshot you want to restore and click Restore. A confirmation dialog appears explaining what will happen: the restore occurs instantly, your current branch remains unchanged, and a new branch will be created with a name like branch_from_snapshot_ followed by the snapshot date and time. Confirm that you want to perform the operation by clicking Restore. A new root branch is created with the snapshot data. Your current branch is left unchanged.
After the restore completes, you see a success message and the Branch overview page for the new branch. The section titled Connect to the new branch to preview restored data explains that you can connect from your application or client to verify the restored data.

Click Get connection details to open a dialog with the new branch's connection information: branch, compute, database, role, and a connection string you can copy. The branch's compute may show as "Pending" while it starts. Once it is active, you can use the connection string to connect.
Other things you can do with your new branch:
- Preview the data. Use the new branch's connection details to check the data and confirm the restore before changing your application configuration. See Connect to your database.
- Rename the branch. Give the branch a clearer name from the branch overview or branches list. See Update branch settings.
- Set as default. If you are satisfied with the restored data, you can make this branch the project's default branch. See Set as default.
- Point your application to the new branch. Once you are sure the data is correct, update your application's connection settings to use this branch's connection details.
- Remove or keep the previous branch. You can delete the branch you were using before if you no longer need it, or keep it as a backup. See Delete a branch.
You can manage the new branch and all project branches from the project's Branches page, where the restored branch appears as a root branch alongside your other branches.
Python SDK
There is no standalone restore operation. Create a branch with source_snapshot set to the snapshot's resource name. This routes branch creation through the restore path, producing a new root branch with the snapshot's data. source_snapshot is mutually exclusive with source_branch, source_branch_lsn, and source_branch_time, and the branch still requires an expiration (no_expiry, ttl, or expire_time). Setting replace_existing: true together with source_snapshot upserts an existing target branch, an idempotent restore.
from databricks.sdk import WorkspaceClient
from databricks.sdk.service.postgres import Branch, BranchSpec
w = WorkspaceClient()
branch = Branch(
spec=BranchSpec(
source_snapshot="projects/my-project/snapshots/my-snapshot",
no_expiry=True,
)
)
result = w.postgres.create_branch(
parent="projects/my-project",
branch=branch,
branch_id="restored-branch",
).wait()
print(f"Branch created: {result.name}")
Java SDK
import com.databricks.sdk.WorkspaceClient;
import com.databricks.sdk.service.postgres.*;
WorkspaceClient w = new WorkspaceClient();
BranchSpec spec = new BranchSpec()
.setSourceSnapshot("projects/my-project/snapshots/my-snapshot")
.setNoExpiry(true);
Branch branch = new Branch().setSpec(spec);
Branch result = w.postgres().createBranch(
new CreateBranchRequest()
.setParent("projects/my-project")
.setBranch(branch)
.setBranchId("restored-branch")
).waitForCompletion();
System.out.println("Branch created: " + result.getName());
CLI
databricks postgres create-branch projects/my-project restored-branch \
--json '{
"spec": {
"source_snapshot": "projects/my-project/snapshots/my-snapshot",
"no_expiry": true
}
}'
Terraform
Restore from a snapshot by declaring a databricks_postgres_branch with source_snapshot set in its spec. Terraform support for snapshots is limited to this restore path — there is no Terraform resource for creating, listing, or deleting snapshots.
resource "databricks_postgres_branch" "restored" {
branch_id = "restored-branch"
parent = "projects/my-project"
spec = {
source_snapshot = "projects/my-project/snapshots/my-snapshot"
no_expiry = true
}
}
curl
There is no standalone restore operation. To restore a snapshot, create a new branch and set source_snapshot on the branch spec to the snapshot's resource name. This routes the branch creation through the restore path, producing a new root branch that contains the snapshot's data. Your existing branches are unchanged.
source_snapshot is mutually exclusive with source_branch, source_branch_lsn, and source_branch_time. Setting replace_existing: true together with source_snapshot upserts an existing target branch, an idempotent restore. The referenced snapshot must be AVAILABLE and belong to the same project as the new branch.
Create the branch from the snapshot. The
branch_idgoes in the query string:curl -X POST "$WORKSPACE/api/2.0/postgres/projects/my-project/branches?branch_id=restored-branch" \ -H "Authorization: Bearer ${DATABRICKS_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "spec": { "source_snapshot": "projects/my-project/snapshots/my-snapshot", "no_expiry": true } }'Poll the returned operation until
doneistrue. The completed operation unpacks to the newBranch.Connect to the new branch to verify the restored data before pointing your application at it. See Create a branch and Connect to your database.
Delete a snapshot
Deleted snapshots can't be recovered.
UI
On the Backup & Restore page in the Lakebase App, find the snapshot in the list, open its kebab menu, and select Delete snapshot.
Python SDK
Deleting a snapshot is a long-running operation. Call .wait() to block until it completes.
from databricks.sdk import WorkspaceClient
w = WorkspaceClient()
w.postgres.delete_snapshot(name="projects/my-project/snapshots/my-snapshot").wait()
print("Snapshot deleted")
Java SDK
import com.databricks.sdk.WorkspaceClient;
WorkspaceClient w = new WorkspaceClient();
w.postgres().deleteSnapshot("projects/my-project/snapshots/my-snapshot")
.waitForCompletion();
System.out.println("Snapshot deleted");
CLI
databricks postgres delete-snapshot projects/my-project/snapshots/my-snapshot
curl
Deleting a snapshot is a long-running operation. The request returns an operation. The completed operation's response is empty.
curl -X DELETE "$WORKSPACE/api/2.0/postgres/projects/my-project/snapshots/my-snapshot" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}" | jq
Poll the returned operation until done is true.
Snapshot storage costs
Starting June 1, 2026, snapshot storage is billable for Lakebase.
Billing is based on the type of snapshot:
- Manual snapshots are charged as full snapshots.
- Scheduled snapshots are charged as full snapshots for the first snapshot in a schedule, then as incremental (delta) storage for subsequent scheduled snapshots.
The size of each snapshot is shown on the Backup & Restore page. For pricing details, see the Lakebase pricing page.
Limitations
The snapshots API has the following limitations:
- Snapshots are immutable. There is no update operation. The source branch, the point-in-time selector, and the expiration are fixed at creation and can't be changed.
- No in-place restore. You restore a snapshot only by creating a new branch from it.
- Same project, available snapshot. The source snapshot must be in the
AVAILABLEstate and must belong to the same project as the new branch. - Mutually exclusive restore fields. On the create-branch request,
source_snapshotcan't be combined withsource_branch, a branch LSN, or a branch timestamp. It can be combined withreplace_existingto upsert an existing target branch. - Terraform. The provider supports restoring from a snapshot only, through the
source_snapshotargument ondatabricks_postgres_branch. There is no Terraform resource for creating, listing, or deleting snapshots. - Beta availability. The snapshots API is available in Beta. To request access, reach out to your Databricks account team.
Related
- Branches — How branching works in Lakebase
- Lakebase API guide — Authentication, resource naming, and long-running operations