Restore from a backup

You can restore a component from the file you created when backing up 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:

    • component_name is the name of the component. Possible values include:
      • apigee-cassandra (Cassandra)
      • apigee-openldap (OpenLDAP)
      • apigee-postgresql (PostgreSQL database)
      • apigee-qpidd (Qpidd)
      • apigee-sso (Edge SSO)
      • 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)
      • edge-ui (Classic UI)
    • backup_file is the name of the file you created when you backed up 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.

    For example:

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

    Specifying backup_file 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