From d2e1d0fbff8e8a87a74bee7f94cecd950754051c Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 4 Mar 2020 12:18:45 +0100 Subject: [PATCH] update instructions to restore postgreSQL dump (#166) --- doc/postgresql_readme.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/postgresql_readme.md b/doc/postgresql_readme.md index 0b91e5351..2cce56c51 100644 --- a/doc/postgresql_readme.md +++ b/doc/postgresql_readme.md @@ -37,12 +37,13 @@ scp root@remote.server.fab:/apps/fabmanager/postgresql/fabmanager_production_$(d Restore the dump with the following: ```bash tar xvf fabmanager_production_$(date -I).tar.gz -sudo cp fabmanager_production_$(date -I).sql .docker/postgresql/ -rake db:drop -rake db:create -docker exec -it fabmanager-postgres bash -cd /var/lib/postgresql/data/ -psql -U postgres -d fabmanager_production -f fabmanager_production_$(date -I).sql +sudo cp fabmanager_production_$(date -I).sql /apps/fabmanager/postgresql/ +cd /apps/fabmanager/ +docker-compose down +docker-compose up -d postgres +docker-compose exec postgres dropdb -U postgres fabmanager_production +docker-compose exec postgres createdb -U postgres fabmanager_production +docker-compose exec postgres pg_restore -U postgres -d fablab_production /var/lib/postgresql/data/fabmanager_production_$(date -I).sql ```