| title | Backup & Database Migration Guide |
|---|---|
| description | Automated MongoDB snapshot creation, archive extraction, and migration between host servers. |
This guide covers backing up your MongoDB database, restoring data, and migrating between servers.
To create a complete snapshot of all profiles, accounts, posts, timelines, and scrape history:
docker exec -t instagram_saved_posts_mongo mongodump --db instagram --archive=/data/db/backup_$(date +%Y%m%d_%H%M%S).archivedocker cp instagram_saved_posts_mongo:/data/db/backup_latest.archive ./backup_latest.archiveTo restore an archive into a running container:
# 1. Copy the archive into the container
docker cp ./backup_latest.archive instagram_saved_posts_mongo:/data/db/backup_restore.archive
# 2. Restore into MongoDB
docker exec -t instagram_saved_posts_mongo mongorestore --db instagram --archive=/data/db/backup_restore.archive --drop- Run the backup command on your old server.
- Transfer
backup_latest.archiveanddocker-compose.ymlto the new server viascporrsync. - Run
docker compose up -don the new server. - Run the restore command on the new server.
- All profiles, session cookies, and post archives will be restored seamlessly!