Skip to content

load

Load a snapshot into the destination database.

clonit load <target> [snapshot_index|file.sql] [flags]
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)

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 snapshots command).
  • SQL file path: Loads a raw SQL file using psql instead of pg_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.

Load the latest snapshot:

clonit load mydb

Load a specific snapshot by index:

clonit load mydb 0

Load from a SQL file:

clonit load mydb /path/to/dump.sql

Load with parallel restore jobs:

clonit load mydb --jobs 8
  • build – Create a snapshot of the source database
  • snapshots – List snapshots for a target
  • pull – Pull a snapshot from remote storage