You can restore a component from the file you created when [backing
up](https://docs.apigee.com/private-cloud/v4.54.00/how-perform-backup) that component. You do this with the `restore` command.

Note that the `restore` command:

- Uses the specified backup file or gets the latest backup file, if a filename was not specified.
- Ensures that the component's data directories are empty.
- Stops the component. You must explicitly restart the component after a restore.

This section describes how to use the `restore` command.

**To restore a component from a backup file:**

1. Ensure that the following directories are empty:

   ```
   /opt/apigee/data/component_name
   /opt/apigee/etc/component_name.d
   ```

   If they are not empty, delete their contents using commands like the following:

       rm -r /opt/apigee/data/component_name
       rm -r /opt/apigee/etc/component_name.d

2. Restore the previous configuration and data by using the following command:

   ```
   /opt/apigee/apigee-service/bin/apigee-service component_name restore backup_file
   ```

   Where:
   - <var translate="no">component_name</var> is the name of the component. Possible values include:
     - `apigee-cassandra` (Cassandra)
     - `apigee-openldap` (OpenLDAP)
     - `apigee-postgresql` (PostgreSQL database)
     - `apigee-qpidd` (Qpidd)
     - `apigee-zookeeper` (ZooKeeper)
     - `edge-management-server` (Management Server)
     - `edge-management-ui` (New Edge UI)
     - `edge-message-processor` (Message Processor)
     - `edge-postgres-server` (Postgres Server)
     - `edge-qpid-server` (Qpid Server)
     - `edge-router` (Edge Router)
   - <var translate="no">backup_file</var> is the name of the file you created when you [backed up](https://docs.apigee.com/private-cloud/v4.54.00/how-perform-backup) that component; this value does not include the path, but does include the "backup-" prefix and file extensions. For example, `backup-2019.03.17,14.40.41.tar.gz`.

   > [!NOTE]
   > **Note:** <var translate="no">backup_file</var> should not include the path or `backup-` prefix, or the file extension. For example, `2019.03.17,14.40.41`.

   > [!NOTE]
   > Note: In the case of `apigee-postgresql` components, <var translate="no">backup_file</var> should not include the path or database name (for example, `apigee-`) as a prefix, nor should it have the `.dump` file extension. For example, if file name is `apigee-2019.03.17,14.40.41.dump`, you should only specify the datetime part: `2019.03.17,14.40.41`.

   For example:

   ```
   /opt/apigee/apigee-service/bin/apigee-service apigee-cassandra restore backup-2019.03.17,14.40.41.tar.gz
   ```

   Specifying <var translate="no">backup_file</var> is optional. If omitted, Apigee uses the most recent file
   in `/opt/apigee/backup/component_name`.

   The `restore` command re-applies the backed up configuration and restores the
   data from when the backup took place.
3. Restart the component, as the following example shows:

   ```
   /opt/apigee/apigee-service/bin/apigee-service component_name start
   ```

> [!NOTE]
> **NOTE:** There is no "restore all" command. You must restore each component individually.