Skip to content

Commit c6b507a

Browse files
authored
Create db-restore.sh
1 parent 080d330 commit c6b507a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

scripts/db-restore.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
if [ -z "$1" ]; then
5+
echo "❌ Usage: $0 <backup-folder>"
6+
exit 1
7+
fi
8+
9+
docker cp $1 mongo:/data/db-restore
10+
docker exec mongo mongorestore --db fullstack_app --drop /data/db-restore/fullstack_app
11+
12+
echo "✅ Restore complete from $1"

0 commit comments

Comments
 (0)