elasticsearch/es-snapshot-create

Create Snapshot

Take snapshot of indices

elasticsearch
snapshot
backup

Command

curl -X PUT 'http://localhost:9200/_snapshot/my_backup/snapshot_1?wait_for_completion=true&pretty'

Explanation

Creates a snapshot (backup) of one or multiple indices. Requires a snapshot repository.

Common Use Cases

  • Backup before migration
  • Disaster recovery
  • Archiving old indices

Best Practices

  • Use S3/GCS for large snapshot repositories
  • Automate snapshots with Curator or ILM

Common Mistakes to Avoid

  • Not registering a repository before snapshot
  • Trying to snapshot a closed index incorrectly

Troubleshooting

Problem: Repository missing

Solution: Register using PUT _snapshot/my_repo.

Problem: Insufficient storage

Solution: Clean up older snapshots or expand disk.

Examples

Backup snapshot for 2025

curl -X PUT 'http://localhost:9200/_snapshot/my_repo/snap_2025?wait_for_completion=true&pretty'