Managing backups using chectl

The following section describes how to create and use backups of a Che installation to perform a recovery or a rollback to a previous version using chectl.

  • Eclipse Che Operator can automatically configure a backup server inside the same cluster; however, it is not recommended for production use.

  • Users who agreed to the limitations coming from the decision to back up their data inside the same Kubernetes namespace or OpenShift project as Che installation may skip this section.

Creating a new backup

  1. To create a backup snapshot and send it to a pre-configured backup server:

    $ chectl server:backup --repository-url=<repository-url> --repository-password=<repository-password>
    • You can create other backups to the same backup server using the server:backup command with no arguments.

    • Using the server:backup command with no arguments for the first time will configure and use an internal backup server.

Restoring from a backup

A Che administrator can use an existing snapshot of a particular Che version to restore a desired state or version. The following instructions describe several variations of the restoration command. Adjust the command arguments according to your use case.

  • To restore the previous functional state of the same version of Che:

    $ chectl server:restore --repository-url=<repository-url> --repository-password=<repository-password> --snapshot-id=<snapshot-id>
  • To roll back to a version different from the current version of Che:

    $ chectl server:restore --version=<version> --snapshot-id=<snapshot-id> --repository-url=<repository-url> --repository-password=<repository-password>

    This performs a version rollback and restores a snapshot made from a previous version of Che. The provided snapshot must be created from the version of Che to which you want to roll back.

    If you have a dedicated backup repository for each Che version and want to use the most recent backup for the version, you can provide the latest argument as a snapshot ID. By doing so, the latest argument will be converted to the latest known ID in the given repository, which will be then used by the Che Operator to recover.
  • To restore a state described by an existing backup Custom Resource:

    $ chectl server:restore --backup-cr-name=<CheClusterBackupCRName>
  • To roll back a version upgrade of Che:

    $ chectl server:restore --rollback

    This recovers the version that Che was using before upgrading to a later version.

    Che Operator automatically creates a backup before every upgrade.