load
Load a snapshot into the destination database.
clonit load <target> [snapshot_index|file.sql] [flags]Arguments
Section titled “Arguments”| Argument | Description | Required |
|---|---|---|
target |
Name of the target | Yes |
snapshot_index or file.sql |
Snapshot index number or path to a SQL file | No |
| Flag | Type | Default | Description |
|---|---|---|---|
--jobs |
int | 0 |
Number of parallel restore jobs (0 = use target default) |
Description
Section titled “Description”Loads a snapshot into the target’s destination database. The command supports three modes depending on the second argument:
- No argument: Loads the latest snapshot.
- Integer index: Loads the snapshot at the specified index (as shown by the
snapshotscommand). - SQL file path: Loads a raw SQL file using
psqlinstead ofpg_restore.
For directory-format snapshots, pg_restore is used. For SQL files (paths ending in .sql), psql is used instead.
The target must have a dst_url configured.
The --jobs flag controls the number of parallel restore jobs. When set to 0, the target’s configured restore_jobs value is used. If that is also 0, pg_restore uses its own default.
Examples
Section titled “Examples”Load the latest snapshot:
clonit load mydbLoad a specific snapshot by index:
clonit load mydb 0Load from a SQL file:
clonit load mydb /path/to/dump.sqlLoad with parallel restore jobs:
clonit load mydb --jobs 8