Database restore
In case you encounter any issues please contact the ARTEMIS team. Feel free to edit this page accordingly.
ATTENTION: First, check that this file has the correct credentials, db name and db.tar location. Volume mappings exist already in the docker-compose file (for backup and current data, as well as db configuration and scripts).
Then, follow the next steps:
- shutdown ARTEMIS
docker-compose down
- If you already have root access, just do the following command and proceed to step 5:
otherwise start backend container to use for cleaning the current data (docker has root access already), and proceed:
rm -rf postgres-data-current/*
docker run --rm -ti --entrypoint="bash" -v "$(pwd)/postgres-data-current:/tmp/data" inspiregroup/artemis-backend
- delete postgres-data folders from within the container
root@4b9830aa0fff:~# rm -rf /tmp/data/*
- exit the container
root@4b9830aa0fff:~# exit
- initiate postgres container
Now the postgres container is running. Leave the current terminal open.
docker-compose run postgres
- from a new terminal, attach to running postgres container. To first see the name of the container, do:
and then attach:
$ docker-compose ps Name Command State Ports ------------------------------------------------------------------------- artemis_postgres_run_{container_id} docker-entrypoint.sh postgres Up 5432/tcp
docker exec -ti artemis_postgres_run_{container_id} bash
- perform the restoration:
Ignore the presented errors, since they do not affect the correctness of the db. You should see something like the following:
bash-4.4# psql -U artemis_user -d artemis_db < docker-entrypoint-initdb.d/data/restore.sql
WARNING: errors ignored on restore: ... You are now connected to database "artemis_db" as user "artemis_user". ALTER DATABASE bash-4.4#
- exit the postgres container:
bash-4.4# exit
- stop and remove postgres container:
docker stop artemis_postgres_run_{container_id} docker rm artemis_postgres_run_{container_id}
- make sure everything is clean
docker-compose down
- start ARTEMIS normally
docker-compose -f ... up -d