1 – Change Postgres (database) password

a. Change postgres password in corresponding docker container

sudo docker exec -it testmodeller_db psql -U admin postgres

alter user postgres with password 'new password';

\q

b. 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

2 – Change Neo4J (graph) password

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

:server change-password


b. 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

3 – Backup (Docker mapped volumes)

Backup /data/ folders to local storage device. To restore backup you will need copy the backup to the /data/ location

4 – Postgres backup to .sql (Docker)

Backup to sql

docker exec -t testmodeller_db pg_dumpall c -U admin > dump_`date +%d%m-%Y""%H%M_%S`.sql

Restore backup

cat your_dump.sql | docker exec -i testmodeller_db psql -U admin

5 – TestModeller – Backup (Native)
Postgres Backup


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

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

Neo4j Backup


Open a new command window and enter the following command. Replacing the parameters with your appropriate details.
bin/neo4j stop            
bin/neo4j-admin dump –database=graph.db –to=/backups/graph.db/2016-10-02.dump

Postgres Restore


Open a new command window and enter the following command. Replacing the parameters with your appropriate details.
psql -h localhost -d -U -f -W

Neo4j Restore


Open a new command window and enter the following command. Replacing 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