---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://ydb.tech/docs/en/recipes/backup-collections/importing-and-restoring.md?version=v26.1
  - https://ydb.tech/docs/ru/recipes/backup-collections/importing-and-restoring.md?version=v26.1
  - href: en/recipes/backup-collections/importing-and-restoring.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
sourcePath: en/core/recipes/backup-collections/importing-and-restoring.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# Importing and Restoring Backups

Import backups from external storage and restore data to your database.

## Importing from filesystem

Import previously exported backups:

```bash
# Import backup to target database
ydb tools restore -p .backups/collections/production_backups_restored -i /backup/exports/production_backups_export

# Import specific backup into a collection
ydb tools restore -p .backups/collections/emergency_restore -i /backup/exports/backup_20250601
```

## Importing from S3

```bash
ydb import s3 \
  --s3-endpoint storage.yandexcloud.net \
  --bucket my-backup-bucket \
  --item src=backups/production_backups,dst=.backups/collections/production_backups
```

## Restoring data

After importing backups to the cluster, restore the data:

```sql
RESTORE production_backups;
```

## Disaster recovery workflow

1. **Import full backup**: Import the base full backup first
2. **Import incrementals**: Import each incremental backup in order
3. **Execute RESTORE**: Run the RESTORE command to apply the backup chain

```bash
# Step 1: Import full backup
ydb tools restore -p .backups/collections/recovery/20250821141425Z_full -i /backup/full_20250821

# Step 2: Import incrementals in order
ydb tools restore -p .backups/collections/recovery/20250822070000Z_incremental -i /backup/inc_20250822

# Step 3: Restore
ydb yql -s "RESTORE recovery;"
```

## Next steps

- [Backup Maintenance and Cleanup](https://ydb.tech/docs/en/recipes/backup-collections/maintenance-and-cleanup.md?version=v26.1)
- [Validating and Testing Backups](https://ydb.tech/docs/en/recipes/backup-collections/validation-and-testing.md?version=v26.1)
