Restore Cloud Management Platform from a backup
3 minute read
The restore process consists of two steps:
- Restoring the CMP database
- Restoring the CMP files
Complete both steps to ensure a full restore of your environment.
These steps cover a single-node deployment, where the web server, job engine, and database all run on one appliance. If your database or shared storage runs on separate hosts, contact CloudBolt Support before restoring.
The web server and job engine will be unavailable during the restore process.
Perform this process during a scheduled maintenance window.
Prerequisites
Before you begin, ensure:
- You have SSH access to the target server
- A complete backup exists, including the database
.tar.gzfile and thecbdumparchive - The backup files are accessible from the target server (for example, transferred to
/var/tmp/) - Required tools (
gunzip,pg_restore,psql) are installed on the target server
Restore the CMP database
The restore can take from minutes to hours, depending on the database size.
-
SSH into the target server.
-
Switch to the root account:
sudo su - -
Stop the Apache HTTP Server:
systemctl stop httpd -
Stop the job engine:
supervisorctl stop jobengine:* -
Retrieve the database password:
postgresql_pass=$(cat /var/opt/cloudbolt/.postgresql_password | grep postgresql_pass | cut -d '=' -f 2) -
Decompress the database backup.
pg_restorecannot read the compressed file.gunzip /var/tmp/pg_base_backup_20260101_123456.tar.gzReplace
pg_base_backup_20260101_123456with the filename of your database backup, here and in the next step. -
Drop the existing database and recreate the schema, then restore from the backup:
sudo -u postgres psql <<END_OF_SQL drop database if exists cloudbolt with (force); drop tablespace if exists cloudbolt_data; drop schema if exists cloudbolt; drop user if exists cb_dba; create tablespace cloudbolt_data location '/var/opt/cloudbolt_pgsql/cloudbolt_data'; create database cloudbolt tablespace cloudbolt_data; create user cb_dba with encrypted password '${postgresql_pass}'; alter role cb_dba in database cloudbolt set search_path to cloudbolt,public; grant all privileges on database cloudbolt to cb_dba; END_OF_SQL PGPASSWORD=${postgresql_pass} pg_restore -h localhost -U cb_dba -e -w --clean --if-exists -d cloudbolt /var/tmp/pg_base_backup_20260101_123456.tar -
Update the
cb_dbaandpostgresuser passwords to match the values stored on this system:postgresql_pass="$(cat /var/opt/cloudbolt/.postgresql_password | grep postgresql_pass | cut -d '=' -f 2)" postgresql_root_pass="$(cat /var/opt/cloudbolt/.postgresql_password | grep postgresql_root_pass | cut -d '=' -f 2)" sudo -u postgres psql <<END_OF_SQL ALTER USER cb_dba WITH PASSWORD '${postgresql_pass}'; ALTER USER postgres WITH PASSWORD '${postgresql_root_pass}' END_OF_SQL
Result: The CMP database is restored from the backup onto your target server.
Restore the CMP files
-
Import the CMP files and configurations using
cb_import:/opt/cloudbolt/manage.py cb_import -v 1 -nd -nb /var/tmp/cbdump-v1.0_20260101_123456.tar.gzReplace
cbdump-v1.0_20260101_123456with the filename of yourcbdumparchive. -
Start the Apache HTTP Server:
systemctl start httpd -
Start the job engine:
supervisorctl start jobengine:*
Result: CMP files and configurations are restored on your target server. The web server and job engine are running.