Populate database with dump from original Cloudbreak instance
If you are using the embedded PostgreSQL database, perform these steps to populate databases with information from the Cloudbreak server.
Steps
- Copy the saved database files from the backup to the new Cloudbreak server host.
- Copy the dump files into the database container with the following commands. Modify the
location as necessary (The example below assumes that the files are in
/tmp
):docker cp /tmp/cbdb.dump cbreak_commondb_1:/cbdb.dump docker cp /tmp/uaadb.dump cbreak_commondb_1:/uaadb.dump docker cp /tmp/periscopedb.dump cbreak_commondb_1:/periscopedb.dump
- Execute the following command to stop the
container:
docker stop cbreak_identity_1
- Execute the following command to enter the container of the
database:
docker exec -it cbreak_commondb_1 bash
- Execute the following commands:
psql -U postgres drop database uaadb; drop database cbdb; drop database periscopedb; create database uaadb; create database cbdb; create database periscopedb;
NoteIf you get
ERROR: database "uaadb" is being accessed by other users
error, ensure that cbreak_identity_1 container is not running and then retry dropping uaadb. - Exit the PostgreSQL interactive terminal.
\q
- Restore the databases from the original
backups:
pg_restore -U postgres -d periscopedb periscopedb.dump pg_restore -U postgres -d cbdb cbdb.dump pg_restore -U postgres -d uaadb uaadb.dump
- Quit from the container with the shortcut
CTRL+d
.