Advanced Cloudbreak Configuration
Also available as:
PDF

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

  1. Copy the saved database files from the backup to the new Cloudbreak server host.
  2. 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
  3. Execute the following command to stop the container:
    docker stop cbreak_identity_1
  4. Execute the following command to enter the container of the database:
    docker exec -it cbreak_commondb_1 bash
  5. 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;
    Note
    Note

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

  6. Exit the PostgreSQL interactive terminal.
    \q
  7. 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
  8. Quit from the container with the shortcut CTRL+d.