Restore Cloud Management Platform from a backup

Restore your Cloud Management Platform (CMP) database and application files from a previously created backup

The restore process consists of two steps:

  1. Restoring the CMP database
  2. 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.

Prerequisites

Before you begin, ensure:

  • You have SSH access to the target server
  • A complete backup exists, including the database .tar.gz file and the cbdump archive
  • 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

  1. SSH into the target server.

  2. Switch to the root account:

    sudo su -
    
  3. Stop the Apache HTTP Server:

    systemctl stop httpd
    
  4. Stop the job engine:

    supervisorctl stop jobengine:*
    
  5. Retrieve the database password:

    postgresql_pass=$(cat /var/opt/cloudbolt/.postgresql_password | grep postgresql_pass | cut -d '=' -f 2)
    
  6. Decompress the database backup. pg_restore cannot read the compressed file.

    gunzip /var/tmp/pg_base_backup_20260101_123456.tar.gz
    
  7. 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
    
  8. Update the cb_dba and postgres user 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

  1. 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.gz
    
  2. Start the Apache HTTP Server:

    systemctl start httpd
    
  3. 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.