Moving a Cloudbreak instance

To transfer a Cloudbreak instance from one host to another, perform these tasks:

  1. If you are using the embedded PostgreSQL database, back up current Cloudbreak database data
  2. Launch a new Cloudbreak instance and start Cloudbreak. Refer to Launch Cloudbreak
  3. If you are using the embedded PostgreSQL database, populate the new Cloudbreak instance database with the dump from the original Cloudbreak instance on the new host.
  4. Modify Cloudbreak Profile

Back up Cloudbreak database

To create a backup of the embedded PostgreSQL database, perform these steps.

Steps

  1. On your Cloudbreak host machine, execute the following command to enter the container of the database:

    docker exec -it cbreak_commondb_1 bash
    If it is not running, start the database container by using the docker start cbreak_commondb_1 command.

  2. Create three database dumps (cbdb, uaadb, periscopedb):

    pg_dump -Fc -U postgres cbdb > cbdb.dump
    pg_dump -Fc -U postgres uaadb > uaadb.dump
    pg_dump -Fc -U postgres periscopedb > periscopedb.dump

  3. Quit from the container with shortcut CTRL+d.

  4. Save the previously created dumps to the host instance:

    docker cp cbreak_commondb_1:/cbdb.dump ./cbdb.dump
    docker cp cbreak_commondb_1:/uaadb.dump ./uaadb.dump
    docker cp cbreak_commondb_1:/periscopedb.dump ./periscopedb.dump

Populate database with dump from original Cloudbreak instance

Perform these steps to populate databases with information from the Cloudbreak server.

Steps

  1. Copy the saved database files from Back up Cloudbreak database 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;

    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.

Modify Cloudbreak Profile

Perform these steps to ensure that your new Profile file is correctly set up.

Steps

  1. Ensure that the following parameter values match in the origin and target Profile files and modify Profile file of the target environment if necessary:

    export UAA_DEFAULT_USER_EMAIL=admin@example.com
    export UAA_DEFAULT_SECRET=cbsecret
    export UAA_DEFAULT_USER_PW=cbuser

  2. Restart Cloudbreak application by using the cbd restart command.

    After performing these steps the migration is complete. To verify, log in to the UI of your new Cloudbreak instance and make sure that it contains the information from your old instance.