# Restore Cloud Management Platform from a backup

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

---

Site [llms.txt](/llms.txt)

---

The restore process consists of two steps:

1. Restoring the CMP database
1. 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](/docs/cmp/support/) before restoring.

<div class="alert alert-warning" role="alert"><div class="h4 alert-heading" role="heading">Service impact</div>


The web server and job engine will be unavailable during the restore process.

Perform this process during a scheduled maintenance window.
</div>


## Prerequisites

Before you begin, ensure:

- You have SSH access to the target server
- [A complete backup exists](/docs/cmp/configure/administration/maintain/back-up/), 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

<div class="alert alert-info" role="alert">


The restore can take from minutes to hours, depending on the database size.
</div>


1. SSH into the target server.
1. Switch to the root account:

   ```bash
   sudo su -
   ```

1. Stop the Apache HTTP Server:

   ```bash
   systemctl stop httpd
   ```

1. Stop the job engine:

   ```bash
   supervisorctl stop jobengine:*
   ```

1. Retrieve the database password:

   ```bash
   postgresql_pass=$(cat /var/opt/cloudbolt/.postgresql_password | grep postgresql_pass | cut -d '=' -f 2)
   ```

1. Decompress the database backup. `pg_restore` cannot read the compressed file.

   ```bash
   gunzip /var/tmp/pg_base_backup_20260101_123456.tar.gz
   ```

   <div class="alert alert-info" role="alert">


   Replace `pg_base_backup_20260101_123456` with the filename of your database backup, here and in the next step.
   </div>


1. Drop the existing database and recreate the schema, then restore from the backup:

   ```bash
   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
   ```

1. Update the `cb_dba` and `postgres` user passwords to match the values stored on this system:

   ```bash
   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`](/docs/cmp/configure/administration/maintain/upgrade/import-export-utilities/):

   ```bash
   /opt/cloudbolt/manage.py cb_import -v 1 -nd -nb /var/tmp/cbdump-v1.0_20260101_123456.tar.gz
   ```

   <div class="alert alert-info" role="alert">


   Replace `cbdump-v1.0_20260101_123456` with the filename of your `cbdump` archive.
   </div>


1. Start the Apache HTTP Server:

   ```bash
   systemctl start httpd
   ```

1. Start the job engine:

   ```bash
   supervisorctl start jobengine:*
   ```

**Result:** CMP files and configurations are restored on your target server. The web server and job engine are running.
