Backup and Recovery

Backup is used to protect against data loss, allowing you to restore data from a backup copy.

YDB provides several solutions for performing backup and recovery:

  • Backup to files and recovery using YDB CLI.
  • Backup to S3-compatible storage and recovery using YDB CLI.

YDB CLI

Files

The following commands are used to back up files:

  • ydb admin cluster dump — for backing up cluster metadata
  • ydb admin database dump — for backing up a database
  • ydb tools dump — for backing up individual schema objects or directories

You can learn more about these commands in Exporting data to the file system.

The following commands are used to perform recovery from a file backup:

  • ydb admin cluster restore — for restoring cluster metadata from a backup
  • ydb admin database restore — for restoring a database from a backup
  • ydb tools restore — for restoring individual schema objects or directories from a backup

You can learn more about these commands in Importing data from the file system.

S3-Compatible Storage

The ydb export s3 command is used to back up data to S3-compatible storage (for example, AWS S3). Follow this link to the YDB CLI reference for information about this command.

The ydb import s3 command is used to recover data from a backup created in S3-compatible storage. Follow this link to the YDB CLI reference for information about this command.

Note

The speed of backup and recovery operations to/from S3-compatible storage is configured to minimize impact on user workload. To control the speed of operations, configure limits for the corresponding queue in the resource broker.