Elasticsearch Restore
Restore Elasticsearch last to populate search indices and analytics data.
Restore Process:
The es-restore.sh script performs the
following operations:
(Click the file name above to download the script.)
- Validates the backup archive exists and is a
.tar.gzfile - Displays a warning about index replacement
- Requires explicit confirmation (type 'yes' or use
--yesflag) - Retrieves Elasticsearch credentials
- Extracts the archive to a temporary directory
- Establishes port-forward to Elasticsearch service (automatic)
- Tests connectivity and records current index count
- Uses
multielasticdumpto restore all indices - Waits for cluster to settle (30 seconds)
- Verifies index count and cluster health
- Cleans up temporary files
Running the Restore:
./es-restore.sh elasticsearch-backup-20251103-122933.tar.gz
Or skip confirmation prompt:
./es-restore.sh elasticsearch-backup-20251103-122933.tar.gz --yes
Expected Output:
========================================
Elasticsearch Restore - Elasticdump
========================================
WARNING: This restore will overwrite indices in the target cluster.
- Indices may be deleted and recreated
- Mappings and settings will be applied from the backup
- Any divergent data may be lost
Type 'yes' to continue: yes
Backup: elasticsearch-backup-20251103-122933.tar.gz
Checking connection... OK
Indices before restore: 0
Starting restore...
[restore progress messages]
✓ Restore completed
Indices before: 0
Indices after: 83
Cluster health: green
✓ Restoration verified
Verification: After restore, verify Elasticsearch data:
# List all indices
curl -u elastic:<password> http://localhost:9200/_cat/indices?v
# Check cluster health
curl -u elastic:<password> http://localhost:9200/_cluster/health?pretty
# Verify document counts
curl -u elastic:<password> http://localhost:9200/_cat/count?v
# Test search functionality
curl -u elastic:<password> http://localhost:9200/<index-name>/_search?size=1