Platform Maintenance

Prev Next

1. Back up

Backup The Prostgres Docker Database:

Create a backup dump file:

Use the script found in the package folder to create a backup dump file:  utils/backup-postgres.sh 

Note: Using the script might require sudo privileges. The Quality Modeller environment needs to be up and running in order to use the script.

Create a backup dump file and place it in package folder

sudo ./utils/backup-postgres.sh

Use -d option to create the backup dump file and place it in a different directory

e.g. /opt/curiosity/backups

sudo ./utils/backup-postgres.sh -d /opt/curiosity/backups

Backup The Postgres Database if it Lives Outside Docker

Open a new command window and enter the following command. Replace the parameters with your appropriate details:

pg_dump -h -p -U -W backup_[date].sql


Neo4J Backup

Backup the Neo4j Docker Database

Open a new command window and enter the following command. Replacing the parameters with your appropriate details.

docker exec -t testmodeller_graph bin/neo4j stop

docker exec -t testmodeller_graph bin/neo4j-admin dump –database=graph.db –to=- > neo4j_dump_date +%d%m-%Y""%H%M_%S.dump


2. Restore

Restore The Postgres Docker Database

Restore from a backup dump file:

Use the utils/restore-postgres.sh script found in the package folder to restore a backup dump file.

Note: Using the script might require sudo privileges. The Quality Modeller environment needs to be down in order to use the script.

Use -d option to point to the backup dump file that was created using the backup command (e.g. /opt/curiosity/backups/postgres_dump_0103-20231904_36.sql)

sudo ./utils/restore-postgres.sh -d /opt/curiosity/backups/postgres_dump_0103-20231904_36.sql

Use -l to also load the DB docker images first (if they haven't been loaded before via the run.sh command)

sudo ./utils/restore-postgres.sh -d /opt/curiosity/backups/postgres_dump_0103-20231904_36.sql -l

Restore The Postgres Database if it Lives Outside Docker

Open a new command window and enter the following command. Replacing the parameters with your appropriate details.

psql -h localhost -d -U -f -W

Restore Neo4j

Open a new command window and enter the following command. Replace the parameters with your appropriate details:

bin/neo4j stop

bin/neo4j-admin load –from=/backups/graph.db/2016-10-02.dump –database=graph.db –force 


3. Change Database Password

Change Postgres Password

Change Postgres password in the corresponding docker container

sudo docker exec -it testmodeller_db psql -U admin postgres
alter user postgres with password 'new password';
\q

Change docker-compose file and restart services (docker-compose down, docker-compose up)

Change environment variable POSTGRES_PASSWORD in postgres_db service 

Change environment variable DATA_PASS in API service

Change Neo4j Password

Navigate to Neo4J machine – http://localhost:7474 and enter below command to change password

:server change-password

Change docker-compose file and restart services (docker-compose down, docker-compose up)

Change environment variable NEO4J_AUTH in neo4j_db service 

Change environment variable GRAPH_PASSWORD in api service