Commit 8218f34a authored by Jérome Perrin's avatar Jérome Perrin

metabase: fix restoring backups

In practice, the restoration was always failing with errors like:

  pg_restore: [archiver (db)] could not execute query: ERROR: schema "???" already exists

because the database was first initialized, but the usual restore
scenario is:
 - instance is populated with initial data
 - data is replaced by restoring the data

this also change the timeout to 5 seconds, 30 is too much
parent bb95ab6c
Pipeline #27630 failed with stage
[instance-profile] [instance-profile]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 0e74c862401f266111552b7a3611f7bf md5sum = c79f0bcf9dac25060340aa829c4f291c
...@@ -190,12 +190,13 @@ wrapper-path = $${directory:bin}/$${:_buildout_section_name_} ...@@ -190,12 +190,13 @@ wrapper-path = $${directory:bin}/$${:_buildout_section_name_}
command-line = command-line =
sh -e -c "\ sh -e -c "\
echo 'This will replace current database with latest backup. Hit Ctrl+C to cancel'; echo 'This will replace current database with latest backup. Hit Ctrl+C to cancel';
sleep 30; sleep 5;
$${postgresql:bin}/pg_restore \ $${postgresql:bin}/pg_restore \
--exit-on-error \ --exit-on-error \
--clean \
--create \
-h $${postgresql:pgdata-directory} \ -h $${postgresql:pgdata-directory} \
-U $${postgresql:superuser} \ -U $${postgresql:superuser} \
-d $${postgresql:dbname} \
$${postgresql-backup:backup-file}" $${postgresql-backup:backup-file}"
[cron] [cron]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment