1.1.E Restore a backup of BOA DDBB - Daniel-Brosnan-Blazquez/vboa GitHub Wiki
Introduction
This procedure covers the action to restore a backup of BOA DDBB.
Be careful when you perform this operation because this will erase all the stored data.
Do not perform this operation if you do not know the implications.
Pre-conditions
- An available BOA environment is ready to use.
Procedure
-
Access to the BOA environment.
-
Restart containers by executing the following command:
Note: the names of the containers may differ between environments (check with docker container list).
docker restart boa_app_dev boa_database_dev
- Copy the backup of BOA DDBB into the database container:
docker cp #BOA_BACKUP# boa_app_dev:/tmp/
- Connect to database:
docker exec -it -u boa boa_app_dev /bin/bash
- Decompress backup:
rm -r /tmp/boa_backup
mkdir /tmp/boa_backup
tar xzvf /tmp/#BOA_BACKUP# -C /tmp/boa_backup
- Execute the following commands to drop the current DDBBs and roles:
psql -h boa_database_dev -U postgres -c "DROP DATABASE eboadb;"
psql -h boa_database_dev -U postgres -c "DROP ROLE eboa;"
psql -h boa_database_dev -t -U postgres -c "DROP DATABASE minarc_orc_db;"
psql -h boa_database_dev -t -U postgres -c "DROP ROLE minarc_orc;"
psql -h boa_database_dev -U postgres -c "DROP DATABASE sboadb;"
psql -h boa_database_dev -U postgres -c "DROP ROLE sboa;"
psql -h boa_database_dev -U postgres -c "DROP DATABASE uboadb;"
psql -h boa_database_dev -U postgres -c "DROP ROLE uboa;"
- Execute the following command to restore the DDBBs:
psql -h boa_database_dev -U postgres < /tmp/boa_backup/boa.sql
- Execute the following command to restore the minArc archive:
rm -r /minarc_root/*
mv /tmp/boa_backup/minarc_root/* /minarc_root/
- Execute the following command to restore the RBOA archive:
rm -r /rboa_archive/*
mv /tmp/boa_backup/rboa_archive/* /rboa_archive/
- Execute the following command to clean-up the backup from the container:
rm -r /tmp/boa_backup /tmp/#BOA_BACKUP#
Now, the backup should have been restored.