Moving a Cloudbreak instance
To transfer a Cloudbreak instance from one host to another, perform these tasks:
- If you are using the embedded PostgreSQL database, back up current Cloudbreak database data
- Launch a new Cloudbreak instance and start Cloudbreak. Refer to Launch Cloudbreak
- 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.
- Modify Cloudbreak Profile
Back up Cloudbreak database
To create a backup of the embedded PostgreSQL database, perform these steps.
Steps
-
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 thedocker start cbreak_commondb_1
command. -
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
-
Quit from the container with shortcut
CTRL+d
. -
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
-
Copy the saved database files from Back up Cloudbreak database 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;
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. -
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
.
Modify Cloudbreak Profile
Perform these steps to ensure that your new Profile file is correctly set up.
Steps
-
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
-
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.