Skip to content

Commit

Permalink
feat: make sure to drop mariadb/mongodb dbs before restoring them
Browse files Browse the repository at this point in the history
  • Loading branch information
robinbourianes-kalisio committed Jul 12, 2024
1 parent 502f1fb commit 4efac45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions charts/kargo/templates/_db-backup.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ spec:
TIMESTAMP=$(date +%Y%m%d-%H%M) &&
BACKUP_FILE={{ .args.host }}-$TIMESTAMP.sql.gz &&
echo "Dumping {{ .args.host }} to $BACKUP_FILE ..." &&
mariadb-dump --defaults-extra-file=/kalisio/my.cnf --host={{ .args.host }} --user={{ .args.username }} --lock-tables --all-databases | gzip > /backup/$BACKUP_FILE
mariadb-dump --defaults-extra-file=/kalisio/my.cnf --host={{ .args.host }} --user={{ .args.username }} --lock-tables --all-databases --add-drop-database | gzip > /backup/$BACKUP_FILE
volumeMounts:
- mountPath: /kalisio/my.cnf
name: db-secret
Expand Down Expand Up @@ -428,7 +428,7 @@ spec:
- -c
- >-
echo "Restoring from {{ $restoreFile }} ..." &&
mongorestore --config=/mongo-config.yml --gzip --archive=/restore/{{ $restoreFile }}
mongorestore --drop --config=/mongo-config.yml --gzip --archive=/restore/{{ $restoreFile }}
volumeMounts:
- mountPath: /mongo-config.yml
name: db-secret
Expand Down

0 comments on commit 4efac45

Please sign in to comment.