Commit 9b6a294a authored by Jérome Perrin's avatar Jérome Perrin

software/metabase: fix backup restoration

use dropdb and createdb command is a working approach to backup
restoration here
parent 696d0c7d
[instance-profile]
filename = instance.cfg.in
md5sum = 0e74c862401f266111552b7a3611f7bf
md5sum = 685e7b371768f6977896d7214fd379f1
......@@ -130,7 +130,7 @@ recipe = slapos.cookbook:generate.password
[postgresql]
recipe = slapos.cookbook:postgres
bin = ${postgresql10:location}/bin/
bin = ${postgresql10:location}/bin
services = $${directory:service}
dbname = metabase_db
superuser = metabase-psql
......@@ -190,7 +190,16 @@ wrapper-path = $${directory:bin}/$${:_buildout_section_name_}
command-line =
sh -e -c "\
echo 'This will replace current database with latest backup. Hit Ctrl+C to cancel';
sleep 30;
sleep 10;
$${postgresql:bin}/dropdb \
-h $${postgresql:pgdata-directory} \
-U $${postgresql:superuser} \
--if-exists \
$${postgresql:dbname};
$${postgresql:bin}/createdb \
-h $${postgresql:pgdata-directory} \
-U $${postgresql:superuser} \
$${postgresql:dbname};
$${postgresql:bin}/pg_restore \
--exit-on-error \
-h $${postgresql:pgdata-directory} \
......
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