# Back up Cloud Management Platform

> Back up your Cloud Management Platform (CMP) database and application files before making major changes, such as upgrading to a new CMP version

---

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

---

The backup process consists of two steps:

1. Backing up the CMP database
1. Backing up the CMP files

Complete both steps to ensure a full backup 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 backing up.

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


The web server and job engine are stopped while the CMP files are backed up. Perform this process during a scheduled maintenance window.
</div>


## Prerequisites

Before you begin, ensure:

- You have SSH access to the database server
- SSH access from the database server to the destination server is configured
- Sufficient disk space is available on the destination server
- Required tools (`pg_dump`, `pv`, `gzip`) are installed on the database server

## Back up the CMP database

1. SSH into your database server.
1. Switch to the root account:

    ```bash
    sudo su -
    ```

1. Retrieve the database password:

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

1. Create the database backup:

    ```bash
    PGPASSWORD=${postgresql_pass} pg_dump -h localhost -p 5432 -U cb_dba -F t cloudbolt |
      pv |
      gzip |
      ssh <username>@<destination-ip-address> "cat > /<destination-directory>/pg_base_backup_$(date +%Y%m%d_%H%M%S).tar.gz"
    ```

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


    Replace `username`, `destination-ip-address`, and `destination-directory` with values appropriate for your environment.
    </div>


**Result:** A `.tar.gz` backup file is created on the destination server.

## Back up the CMP files

1. SSH into your CMP 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. Export the `/var/opt/cloudbolt/` and `/var/www/html/cloudbolt/static/uploads/` directories:

    ```bash
    /opt/cloudbolt/manage.py cb_export -ic -is -nm -na
    ```

1. Start the Apache HTTP Server:

    ```bash
    systemctl start httpd
    ```

1. Start the job engine:

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

**Result:** An export archive is generated, and the web server and job engine are running again.
