Skip to content

tt backup

Manage Tarantool backups (PITR)

Usage

tt backup
tt backup [flags] <command> [command flags]

Commands

tt backup finalize

Run box.backup.stop() on the instance and remove the local .tar.zst archive. Idempotent: if the backup is already closed, it does not fail.

--dir removes the artifacts from the directory 'tt backup start --dir' wrote them to and leaves that directory in place. Without it they are looked up in $TMPDIR/tt-backup/<backup-id>/, which is removed once it is empty.

--force closes whatever backup is open on the instance without naming a --backup-id, for when the id that opened it is unknown or not trusted. It only runs box.backup.stop(): no local archive or fragment is removed.

<APP:INSTANCE> is reached as tt connect --binary reaches it: at iproto.advertise.client of its config, else at the first TCP address of its iproto.listen, else at its binary port, with TLS and the TLS files of the iproto.listen entry there. --sslkeyfile, --sslcertfile, --sslcafile and --sslciphers take precedence over those files, and reach a <URI> whose listener has TLS enabled. The credentials are those of --username and --password, and for a <URI> without any those of TT_CLI_USERNAME and TT_CLI_PASSWORD.

Usage

tt backup finalize (<APP:INSTANCE>|<URI>) [flags]

Flags

  • --auth-type string - authentication method: auto, chap-sha1 or pap-sha256; pap-sha256 needs TLS and Tarantool EE or CE 3.9+ (default auto)
  • --backup-id string - backup identifier; local artifacts of the target replicaset are removed
  • --connect-timeout duration - timeout for establishing a binary connection (default 1s)
  • --dir string - directory holding the artifacts to remove; defaults to $TMPDIR/tt-backup/<backup-id>
  • --force - close whatever backup is open on the instance; removes no local file
  • -p, --password string - password
  • --scope string - scope the application is looked for in: project, user or system
  • --sslcafile string - path to a trusted certificate authorities (CA) file
  • --sslcertfile string - path to an SSL certificate file
  • --sslciphers string - colon-separated (:) list of SSL cipher suites
  • --sslkeyfile string - path to a private SSL key file
  • --sslpassword string - password for decrypting the private SSL key file
  • --sslpasswordfile string - path to a file containing the password for decrypting the private SSL key file
  • --template string - template of the application the instances are described in (default "default")
  • -u, --username string - username

tt backup gc

Delete backups the retention rules no longer cover, and clean up archives

    no manifest refers to.

    Retention rules combine: a backup is deleted only when no rule keeps it.
    Deletion cascades: a full backup goes only together with every increment
    based on it, and a chain is cut from its newest end, so a kept increment
    always keeps the backups it is recovered from.

    Three things are never deleted, whatever the rules say: the chain holding
    the newest manifest, because an upload may be appending to it; the newest
    chain that can still be recovered from; and archives newer than the newest
    stored manifest. This means gc cannot empty a storage; remove the storage
    root with your storage tooling if that is what you want.

    Chains with problems (a fork, a tail whose full backup is gone) are left
    for 'tt backup verify' to report.

    A dangling archive is re-checked with a direct read of its manifest just
    before it is deleted, so a run may keep an archive its plan listed.

The --backup-storage flag accepts a URI describing the storage backend, or @<path> naming a YAML config file:

file://<abs_path>?Prefix=<subdir>
  Local filesystem storage. The path must be absolute.
  Query parameters:
    Prefix           - subdirectory within the path (optional).

s3://<bucket>/<prefix>
  S3 storage taken from the standard AWS_* environment variables, so that
  no credential is written in the command line:
    AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY  - credentials (required).
    AWS_SESSION_TOKEN                         - for temporary credentials.
    AWS_REGION, AWS_DEFAULT_REGION            - region.
    AWS_ENDPOINT_URL, AWS_ENDPOINT_URL_S3     - endpoint of an
                                                S3-compatible storage.
    AWS_CA_BUNDLE                             - CA of an endpoint the
                                                system roots do not cover.

s3+https://host/bucket/prefix?AccessKeyID=...&SecretAccessKey=...
s3+http://host/bucket/prefix?AccessKeyID=...&SecretAccessKey=...
  S3-compatible storage with the endpoint and the credentials in the URI.
  Use s3+https for TLS, s3+http for plain TCP. The first path segment
  after the host is the bucket name, the rest is the optional key prefix.
  Query parameters:
    Region           - AWS region (optional).
    AccessKeyID      - access key ID (required).
    SecretAccessKey  - secret access key (required).

@<path>.yaml
  What a URI cannot express: a custom endpoint, a region, explicit
  credentials, a private CA. The backend is chosen by 'type', an unknown
  field is an error, and ${VAR} in a value is read from the environment
  ('$$' is a literal '$'), so a secret stays out of the file:

    type: s3
    endpoint: https://storage.yandexcloud.net # https unless http:// is asked
    for
    region: ru-central1
    bucket: payments-backups
    prefix: tarantool # storage root in the bucket, optional
    access_key_id: ${AWS_ACCESS_KEY_ID}          # optional, AWS_* by default
    secret_access_key: ${AWS_SECRET_ACCESS_KEY}
    ca_cert: /etc/ssl/private-ca.pem             # or skip_verify: true

    type: fs
    root: /mnt/backups/payments        # storage root, must be absolute
    prefix: mycluster                  # subdirectory within the root, optional

--cluster-name and --environment select a subtree of that storage, <storage_root>/<cluster_name>/<environment>/, and every command reading or writing a storage takes them. They compose with the prefix above, so one storage can hold several clusters. Pass the same pair to every command: a backup uploaded with them is invisible to a verify, gc, last or plan run without them, and those commands report an empty storage rather than an error. The exception is upload, which reads the pair out of the plan and needs the flags only to override it.

Usage

tt backup gc [flags]

Flags

  • --backup-storage string - storage URI or @path to a storage configuration file
  • --cluster-name string - cluster name; used as a storage path component
  • --dry-run - report what would be deleted without deleting anything; a real run reports what it kept vs what the plan listed
  • --environment string - environment tag (production, staging, ...); used as a storage path component, requires --cluster-name
  • --format string - output format: table or json (default table)
  • --keep-days int - keep backups created within the last D days
  • --keep-full int - keep the last N healthy backup chains; without --keep-full or --keep-days nothing is deleted at all
  • --orphan-age duration - minimum age before a dangling archive or a problem chain tail is deleted; 0 means the default (default 24h0m0s)
  • --timeout duration - timeout for connecting to and working with the storage; 0 means no limit (default 10m0s)

Examples

$ tt backup gc --backup-storage=file:///var/backups --keep-full 3 --dry-run
$ tt backup gc --backup-storage=file:///var/backups --keep-days 30
$ tt backup gc --backup-storage=file:///var/backups --keep-full 2 --keep-days 7

tt backup id

Print an identifier for a new backup: the current UTC time as 20060102T150405Z, followed by a newline. Pass it as is to --backup-id of 'tt backup start', 'tt backup upload' and 'tt backup finalize'.

Identifiers sort as text in the order they are generated, which is the order 'tt backup upload' requires. The command exits once the second it printed is over, so the next call prints a later one.

That holds for calls made one after another on one host. Calls running at the same time, calls on different hosts, or a clock stepped back can print the same identifier; generate one per backup run and hand it to every step.

Usage

tt backup id

tt backup last

Find the latest manifest in the storage and print it to stdout.

The --backup-storage flag accepts a URI describing the storage backend, or @<path> naming a YAML config file:

file://<abs_path>?Prefix=<subdir>
  Local filesystem storage. The path must be absolute.
  Query parameters:
    Prefix           - subdirectory within the path (optional).

s3://<bucket>/<prefix>
  S3 storage taken from the standard AWS_* environment variables, so that
  no credential is written in the command line:
    AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY  - credentials (required).
    AWS_SESSION_TOKEN                         - for temporary credentials.
    AWS_REGION, AWS_DEFAULT_REGION            - region.
    AWS_ENDPOINT_URL, AWS_ENDPOINT_URL_S3     - endpoint of an
                                                S3-compatible storage.
    AWS_CA_BUNDLE                             - CA of an endpoint the
                                                system roots do not cover.

s3+https://host/bucket/prefix?AccessKeyID=...&SecretAccessKey=...
s3+http://host/bucket/prefix?AccessKeyID=...&SecretAccessKey=...
  S3-compatible storage with the endpoint and the credentials in the URI.
  Use s3+https for TLS, s3+http for plain TCP. The first path segment
  after the host is the bucket name, the rest is the optional key prefix.
  Query parameters:
    Region           - AWS region (optional).
    AccessKeyID      - access key ID (required).
    SecretAccessKey  - secret access key (required).

@<path>.yaml
  What a URI cannot express: a custom endpoint, a region, explicit
  credentials, a private CA. The backend is chosen by 'type', an unknown
  field is an error, and ${VAR} in a value is read from the environment
  ('$$' is a literal '$'), so a secret stays out of the file:

    type: s3
    endpoint: https://storage.yandexcloud.net # https unless http:// is asked
    for
    region: ru-central1
    bucket: payments-backups
    prefix: tarantool # storage root in the bucket, optional
    access_key_id: ${AWS_ACCESS_KEY_ID}          # optional, AWS_* by default
    secret_access_key: ${AWS_SECRET_ACCESS_KEY}
    ca_cert: /etc/ssl/private-ca.pem             # or skip_verify: true

    type: fs
    root: /mnt/backups/payments        # storage root, must be absolute
    prefix: mycluster                  # subdirectory within the root, optional

--cluster-name and --environment select a subtree of that storage, <storage_root>/<cluster_name>/<environment>/, and every command reading or writing a storage takes them. They compose with the prefix above, so one storage can hold several clusters. Pass the same pair to every command: a backup uploaded with them is invisible to a verify, gc, last or plan run without them, and those commands report an empty storage rather than an error. The exception is upload, which reads the pair out of the plan and needs the flags only to override it.

Usage

tt backup last --backup-storage=<uri> [--format <table|json>] [flags]

Flags

  • --backup-storage string - storage URI or @path to a storage configuration file
  • --cluster-name string - cluster name; used as a storage path component
  • --environment string - environment tag (production, staging, ...); used as a storage path component, requires --cluster-name
  • --format table - output format: table or `json` (default table)
  • --timeout duration - timeout for connecting to and reading from the storage; 0 means no limit (default 1m0s)

Examples

$ tt backup last --backup-storage=file:///var/backups
$ tt backup last --backup-storage=file:///var/backups?Prefix=mycluster
$ tt backup last --backup-storage=s3://payments-backups/tarantool
$ tt backup last --backup-storage=@s3-prod.yaml
$ tt backup last --backup-storage=s3+https://s3.example.com:9000/... \
  ?Region=us-east-1&AccessKeyID=minio&SecretAccessKey=minio123
$ tt backup last --backup-storage=file:///var/backups --format json
$ tt backup last --backup-storage=file:///var/backups \
  --cluster-name payments-cluster --environment production

tt backup plan

Compute a backup plan from the current cluster topology and the latest manifest in the storage.

The cluster configuration comes from --config: either the cluster configuration file (cluster.yaml) or the URI of the etcd or Tarantool Config Storage the cluster is configured from. <APP> names an application tt runs instead, found as the instance commands find it, with --scope and --template: the configuration is the one of its pair, and a relative unix socket of an instance is taken against the application directory its instances run in.

backup mode (required):

incremental - build on top of the latest manifest (requires a valid chain)
full        - start a new chain, no chain checks

For --target=incremental the command loads the latest manifest, builds the backup chain, and verifies that the latest manifest is the chain's latest entry with no problems. If any check fails, the command exits with a detailed error (no auto-promotion to full).

The --backup-storage flag accepts a URI describing the storage backend, or @<path> naming a YAML config file:

file://<abs_path>?Prefix=<subdir>
  Local filesystem storage. The path must be absolute.
  Query parameters:
    Prefix           - subdirectory within the path (optional).

s3://<bucket>/<prefix>
  S3 storage taken from the standard AWS_* environment variables, so that
  no credential is written in the command line:
    AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY  - credentials (required).
    AWS_SESSION_TOKEN                         - for temporary credentials.
    AWS_REGION, AWS_DEFAULT_REGION            - region.
    AWS_ENDPOINT_URL, AWS_ENDPOINT_URL_S3     - endpoint of an
                                                S3-compatible storage.
    AWS_CA_BUNDLE                             - CA of an endpoint the
                                                system roots do not cover.

s3+https://host/bucket/prefix?AccessKeyID=...&SecretAccessKey=...
s3+http://host/bucket/prefix?AccessKeyID=...&SecretAccessKey=...
  S3-compatible storage with the endpoint and the credentials in the URI.
  Use s3+https for TLS, s3+http for plain TCP. The first path segment
  after the host is the bucket name, the rest is the optional key prefix.
  Query parameters:
    Region           - AWS region (optional).
    AccessKeyID      - access key ID (required).
    SecretAccessKey  - secret access key (required).

@<path>.yaml
  What a URI cannot express: a custom endpoint, a region, explicit
  credentials, a private CA. The backend is chosen by 'type', an unknown
  field is an error, and ${VAR} in a value is read from the environment
  ('$$' is a literal '$'), so a secret stays out of the file:

    type: s3
    endpoint: https://storage.yandexcloud.net # https unless http:// is asked
    for
    region: ru-central1
    bucket: payments-backups
    prefix: tarantool # storage root in the bucket, optional
    access_key_id: ${AWS_ACCESS_KEY_ID}          # optional, AWS_* by default
    secret_access_key: ${AWS_SECRET_ACCESS_KEY}
    ca_cert: /etc/ssl/private-ca.pem             # or skip_verify: true

    type: fs
    root: /mnt/backups/payments        # storage root, must be absolute
    prefix: mycluster                  # subdirectory within the root, optional

--cluster-name and --environment select a subtree of that storage, <storage_root>/<cluster_name>/<environment>/, and every command reading or writing a storage takes them. They compose with the prefix above, so one storage can hold several clusters. Pass the same pair to every command: a backup uploaded with them is invisible to a verify, gc, last or plan run without them, and those commands report an empty storage rather than an error. The exception is upload, which reads the pair out of the plan and needs the flags only to override it.

cluster configuration source: a path to the cluster configuration file (cluster.yaml), or a URI of etcd or Tarantool Config Storage. A value that parses as a URI is fetched from the storage; anything else is read as a file.

The URL specifies the etcd or tarantool config storage connection settings in the following format: http(s)://[username:password@]host:port/prefix[?arguments]

  • prefix - a base path to Tarantool configuration in etcd or tarantool config storage.

Possible arguments:

  • key - a target configuration key in the prefix.
  • name - a name of an instance in the cluster configuration.
  • timeout - a request timeout in seconds (default 3.0).
  • ssl_key_file - a path to a private SSL key file.
  • ssl_cert_file - a path to an SSL certificate file.
  • ssl_ca_file - a path to a trusted certificate authorities (CA) file.
  • ssl_ca_path - a path to a trusted certificate authorities (CA) directory.
  • ssl_ciphers - a list of allowed SSL ciphers.
  • verify_host - set off (default true) verification of the certificate’s name against the host.
  • verify_peer - set off (default true) verification of the peer’s SSL certificate.

The command supports the following environment variables:

  • TT_CLI_USERNAME - specifies the Tarantool username;
  • TT_CLI_PASSWORD - specifies the Tarantool password.
  • TT_CLI_ETCD_USERNAME - specifies the etcd username;
  • TT_CLI_ETCD_PASSWORD - specifies the etcd password.

The priority of credentials: environment variables < command flags < URL credentials.

HTTPS connection behavior:

  • The https:// scheme enables TLS for both etcd and Tarantool Config Storage (TCS), even when no ssl_* URL arguments are specified.
  • For etcd, certificate verification is skipped if neither ssl_ca_file nor ssl_ca_path is specified. A configured CA enables verification unless explicitly disabled.
  • TCS keeps the certificate verification behavior of its TLS backend. The default Go backend uses system CAs unless ssl_ca_file is specified.
  • Do not mix http:// and https:// addresses in an etcd endpoint list. If any endpoint uses https://, TLS is enabled for all endpoints.

Usage

tt backup plan [<APP>] --target=(incremental|full) --backup-storage=<uri> [flags]

Flags

  • --auth-type string - authentication method: auto, chap-sha1 or pap-sha256; pap-sha256 needs TLS and Tarantool EE or CE 3.9+ (default auto)
  • --backup-storage string - storage URI or @path to a storage configuration file
  • --cluster-name string - cluster name; used as a storage path component
  • -c, --config string - cluster configuration file or config storage URI
  • --connect-timeout duration - timeout for establishing a binary connection (default 1s)
  • --environment string - environment tag (production, staging, ...); used as a storage path component, requires --cluster-name
  • --format string - output format: table or json (default json)
  • -p, --password string - password for the URI case
  • --scope string - scope the application is looked for in: project, user or system
  • --sslcafile string - path to a trusted certificate authorities (CA) file for the URI case
  • --sslcertfile string - path to an SSL certificate file for the URI case
  • --sslciphers string - colon-separated (:) list of SSL cipher suites for the URI case
  • --sslkeyfile string - path to a private SSL key file for the URI case
  • --sslpassword string - password for decrypting the private SSL key file for a cluster connection
  • --sslpasswordfile string - path to a file containing the private SSL key password for a cluster connection
  • --target string - backup mode: incremental or full (required)
  • --template string - template of the application the instances are described in (default "default")
  • --timeout duration - timeout for storage operations; 0 means no limit (default 1m0s)
  • -u, --username string - username for the URI case

Examples

$ tt backup plan myapp --target=full --backup-storage=file:///var/backups
$ tt backup plan --target=incremental --backup-storage=file:///var/backups \
  -c cluster.yaml
$ tt backup plan --target=incremental --backup-storage=file:///var/backups \
  -c http://etcd.example.com:2379/tt
$ tt backup plan --target=full --backup-storage=file:///var/backups --format json \
  -c cluster.yaml
$ tt backup plan --target=incremental --backup-storage=s3+https://... -c cluster.yaml
$ tt backup plan --target=incremental --backup-storage=file:///var/backups \
  -c cluster.yaml --cluster-name payments-cluster --environment production

tt backup start

Open box.backup on the instance, pack WAL files and a per-shard manifest fragment into a .tar.zst archive, and leave box.backup open. The archive path is printed to stdout. Closing box.backup is done by 'tt backup finalize' after the manifest has been uploaded. Exit code 3 means a backup is already in progress; request and system failures use exit codes 1 and 2.

A full backup ships the instance's newest checkpoint as it is, and every member of a replicaset restored from it boots from that snapshot. Tarantool looks each member's name up in the snapshot alone, so a checkpoint taken before a member registered or was named -- the bootstrap snapshot of a freshly deployed cluster, typically -- restores only members whose configuration pins database.instance_uuid.

--snapshot takes a new checkpoint with box.snapshot() before the full backup opens: the full then ships a snapshot of the instance as it is, with next to no journal to replay after it, at the cost of writing the whole data set to disk once more. A checkpoint already in progress on the instance -- the checkpoint daemon's, say -- is waited out, for up to an hour, and shipped in place of a new one. A box.snapshot() that fails stops the command before anything is opened. It is refused together with --from-vclock.

--dir writes both artifacts directly into the given directory, which is created if it does not exist. Without it they go to $TMPDIR/tt-backup/<backup-id>/.

<APP:INSTANCE> is reached as tt connect --binary reaches it: at iproto.advertise.client of its config, else at the first TCP address of its iproto.listen, else at its binary port, with TLS and the TLS files of the iproto.listen entry there. --sslkeyfile, --sslcertfile, --sslcafile and --sslciphers take precedence over those files, and reach a <URI> whose listener has TLS enabled. The credentials are those of --username and --password, and for a <URI> without any those of TT_CLI_USERNAME and TT_CLI_PASSWORD.

Usage

tt backup start (<APP:INSTANCE>|<URI>) [flags]

Flags

  • --auth-type string - authentication method: auto, chap-sha1 or pap-sha256; pap-sha256 needs TLS and Tarantool EE or CE 3.9+ (default auto)
  • --backup-id string - backup identifier (required); 'tt backup id' prints a new one
  • --connect-timeout duration - timeout for establishing a binary connection (default 1s)
  • --dir string - directory for the archive and the manifest fragment; defaults to $TMPDIR/tt-backup/<backup-id>
  • --from-vclock string - vclock of the last manifest (JSON object, e.g. '{"1":1500}'); incremental only
  • -p, --password string - password
  • --scope string - scope the application is looked for in: project, user or system
  • --snapshot - take a new checkpoint with box.snapshot() before a full backup; full only
  • --sslcafile string - path to a trusted certificate authorities (CA) file
  • --sslcertfile string - path to an SSL certificate file
  • --sslciphers string - colon-separated (:) list of SSL cipher suites
  • --sslkeyfile string - path to a private SSL key file
  • --sslpassword string - password for decrypting the private SSL key file
  • --sslpasswordfile string - path to a file containing the password for decrypting the private SSL key file
  • --template string - template of the application the instances are described in (default "default")
  • --ttl duration - force the backup to complete after this duration (default 1h0m0s)
  • -u, --username string - username

tt backup upload

Run on the manager host after the orchestrator collected .tar.zst archives and instance_backup.json fragments from all cluster nodes.

The cluster and the environment come from the plan, which is where they were decided; --cluster-name / --environment are only needed to override them, and the run says so when they do.

A replicaset the plan expects but no fragment covers, or a fragment whose archive never arrived, does not fail the run: it is recorded as a failed shard with a shard_unreachable / shard_partial warning, and the manifest is still stored for every replicaset that did produce data. The status the run reports says whether the backup is ok, degraded or failed.

The --backup-storage flag accepts a URI describing the storage backend, or @<path> naming a YAML config file:

file://<abs_path>?Prefix=<subdir>
  Local filesystem storage. The path must be absolute.
  Query parameters:
    Prefix           - subdirectory within the path (optional).

s3://<bucket>/<prefix>
  S3 storage taken from the standard AWS_* environment variables, so that
  no credential is written in the command line:
    AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY  - credentials (required).
    AWS_SESSION_TOKEN                         - for temporary credentials.
    AWS_REGION, AWS_DEFAULT_REGION            - region.
    AWS_ENDPOINT_URL, AWS_ENDPOINT_URL_S3     - endpoint of an
                                                S3-compatible storage.
    AWS_CA_BUNDLE                             - CA of an endpoint the
                                                system roots do not cover.

s3+https://host/bucket/prefix?AccessKeyID=...&SecretAccessKey=...
s3+http://host/bucket/prefix?AccessKeyID=...&SecretAccessKey=...
  S3-compatible storage with the endpoint and the credentials in the URI.
  Use s3+https for TLS, s3+http for plain TCP. The first path segment
  after the host is the bucket name, the rest is the optional key prefix.
  Query parameters:
    Region           - AWS region (optional).
    AccessKeyID      - access key ID (required).
    SecretAccessKey  - secret access key (required).

@<path>.yaml
  What a URI cannot express: a custom endpoint, a region, explicit
  credentials, a private CA. The backend is chosen by 'type', an unknown
  field is an error, and ${VAR} in a value is read from the environment
  ('$$' is a literal '$'), so a secret stays out of the file:

    type: s3
    endpoint: https://storage.yandexcloud.net # https unless http:// is asked
    for
    region: ru-central1
    bucket: payments-backups
    prefix: tarantool # storage root in the bucket, optional
    access_key_id: ${AWS_ACCESS_KEY_ID}          # optional, AWS_* by default
    secret_access_key: ${AWS_SECRET_ACCESS_KEY}
    ca_cert: /etc/ssl/private-ca.pem             # or skip_verify: true

    type: fs
    root: /mnt/backups/payments        # storage root, must be absolute
    prefix: mycluster                  # subdirectory within the root, optional

--cluster-name and --environment select a subtree of that storage, <storage_root>/<cluster_name>/<environment>/, and every command reading or writing a storage takes them. They compose with the prefix above, so one storage can hold several clusters. Pass the same pair to every command: a backup uploaded with them is invisible to a verify, gc, last or plan run without them, and those commands report an empty storage rather than an error. The exception is upload, which reads the pair out of the plan and needs the flags only to override it.

Usage

tt backup upload [flags]

Flags

  • --archives string - comma-separated paths to .tar.zst archives (required)
  • --backup-id string - backup identifier, e.g. 20260326T120000Z (required); ids order the chain, so it must sort as text above every backup already stored
  • --backup-storage string - storage URI or @path to a storage configuration file
  • --cluster-name string - cluster name; used as a storage path component
  • --environment string - environment tag (production, staging, ...); used as a storage path component, requires --cluster-name
  • --fragments string - comma-separated paths to per-shard instance_backup.json fragments
  • --keep-local - keep local .tar.zst copies on the manager host after successful upload
  • --plan string - path to tt backup plan JSON (required); provides type, previous_backup_id, expected replicasets and the cluster and environment the backup belongs to
  • --timeout duration - timeout for storage operations; 0 means no limit (default 30m0s)

Examples

$ tt backup upload \
  --archives /tmp/bkp/20260326T120000Z-A.tar.zst,/tmp/bkp/20260326T120000Z-B.tar.zst \
  --fragments /tmp/bkp/A.json,/tmp/bkp/B.json \
  --plan /tmp/bkp/plan.json \
  --backup-storage file:///var/backups \
  --backup-id 20260326T120000Z

$ tt backup upload --plan /tmp/bkp/plan.json --environment staging \
  --archives /tmp/bkp/20260326T120000Z-A.tar.zst \
  --fragments /tmp/bkp/A.json \
  --backup-storage file:///var/backups \
  --backup-id 20260326T120000Z

tt backup verify

Health-check the backup storage and report what is wrong with it.

    The check reads the whole storage and reports:
      - manifests referring to archives that are not stored;
      - archives whose bytes do not match checksum_sha256 of the manifest;
      - breaks in the previous_backup_id chain (orphans and forks);
      - increments whose vclock_begin does not continue the previous backup;
      - archives no manifest refers to.

    An archive of a backup newer than every stored manifest is reported too, but
    as an upload in progress rather than a problem: an upload writes its archives
    before the manifest that references them, so this is what a backup being taken
    right now looks like from the outside.

    Nothing is ever deleted or repaired: removing backups is 'tt backup gc'.
    Exit codes: 0 - the storage is healthy, 3 - problems were found,
    1 - the request is invalid, 2 - a system failure prevented the check.

The --backup-storage flag accepts a URI describing the storage backend, or @<path> naming a YAML config file:

file://<abs_path>?Prefix=<subdir>
  Local filesystem storage. The path must be absolute.
  Query parameters:
    Prefix           - subdirectory within the path (optional).

s3://<bucket>/<prefix>
  S3 storage taken from the standard AWS_* environment variables, so that
  no credential is written in the command line:
    AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY  - credentials (required).
    AWS_SESSION_TOKEN                         - for temporary credentials.
    AWS_REGION, AWS_DEFAULT_REGION            - region.
    AWS_ENDPOINT_URL, AWS_ENDPOINT_URL_S3     - endpoint of an
                                                S3-compatible storage.
    AWS_CA_BUNDLE                             - CA of an endpoint the
                                                system roots do not cover.

s3+https://host/bucket/prefix?AccessKeyID=...&SecretAccessKey=...
s3+http://host/bucket/prefix?AccessKeyID=...&SecretAccessKey=...
  S3-compatible storage with the endpoint and the credentials in the URI.
  Use s3+https for TLS, s3+http for plain TCP. The first path segment
  after the host is the bucket name, the rest is the optional key prefix.
  Query parameters:
    Region           - AWS region (optional).
    AccessKeyID      - access key ID (required).
    SecretAccessKey  - secret access key (required).

@<path>.yaml
  What a URI cannot express: a custom endpoint, a region, explicit
  credentials, a private CA. The backend is chosen by 'type', an unknown
  field is an error, and ${VAR} in a value is read from the environment
  ('$$' is a literal '$'), so a secret stays out of the file:

    type: s3
    endpoint: https://storage.yandexcloud.net # https unless http:// is asked
    for
    region: ru-central1
    bucket: payments-backups
    prefix: tarantool # storage root in the bucket, optional
    access_key_id: ${AWS_ACCESS_KEY_ID}          # optional, AWS_* by default
    secret_access_key: ${AWS_SECRET_ACCESS_KEY}
    ca_cert: /etc/ssl/private-ca.pem             # or skip_verify: true

    type: fs
    root: /mnt/backups/payments        # storage root, must be absolute
    prefix: mycluster                  # subdirectory within the root, optional

--cluster-name and --environment select a subtree of that storage, <storage_root>/<cluster_name>/<environment>/, and every command reading or writing a storage takes them. They compose with the prefix above, so one storage can hold several clusters. Pass the same pair to every command: a backup uploaded with them is invisible to a verify, gc, last or plan run without them, and those commands report an empty storage rather than an error. The exception is upload, which reads the pair out of the plan and needs the flags only to override it.

Usage

tt backup verify [flags]

Flags

  • --backup-storage string - storage URI or @path to a storage configuration file
  • --cluster-name string - cluster name; used as a storage path component
  • --environment string - environment tag (production, staging, ...); used as a storage path component, requires --cluster-name
  • --format string - output format: table or json (default table)
  • --timeout duration - timeout for connecting to and reading from the storage; 0 means no limit (default 30m0s)

Examples

$ tt backup verify --backup-storage=file:///var/backups
$ tt backup verify --backup-storage=file:///var/backups --format json