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] [instance-profile]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 0e74c862401f266111552b7a3611f7bf md5sum = 685e7b371768f6977896d7214fd379f1
...@@ -130,7 +130,7 @@ recipe = slapos.cookbook:generate.password ...@@ -130,7 +130,7 @@ recipe = slapos.cookbook:generate.password
[postgresql] [postgresql]
recipe = slapos.cookbook:postgres recipe = slapos.cookbook:postgres
bin = ${postgresql10:location}/bin/ bin = ${postgresql10:location}/bin
services = $${directory:service} services = $${directory:service}
dbname = metabase_db dbname = metabase_db
superuser = metabase-psql superuser = metabase-psql
...@@ -190,7 +190,16 @@ wrapper-path = $${directory:bin}/$${:_buildout_section_name_} ...@@ -190,7 +190,16 @@ 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 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 \ $${postgresql:bin}/pg_restore \
--exit-on-error \ --exit-on-error \
-h $${postgresql:pgdata-directory} \ -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