Restoring a Che instance from a backup
You can restore a Che instance from a backup snapshot by using the CheClusterRestore
custom object or chectl
:
Restoring a Che instance from a backup by using the CheClusterRestore custom object
You can restore a Che instance from a backup snapshot by using custom resources. A new CheClusterRestore
custom object is required every time you restore a Che instance from a backup snapshot. (So editing an already consumed CheClusterRestore
custom object, during or after backing up, has no effect.)
Backup snapshots are bound to a Kubernetes or OpenShift cluster. To restore a Che instance, you must only use a backup snapshot that was created in the same Kubernetes or OpenShift cluster. |
Do not use the CheClusterRestore custom object to recover a Che instance of an earlier version of Che! Use only chectl to recover a Che instance of an earlier version of Che; see Restoring a Che instance from a backup by using chectl!
|
-
Backup snapshot of a Che instance on any of the following:
-
Create the
CheClusterRestore
custom object, which restores a backup:apiVersion: org.eclipse.che/v1 kind: CheClusterRestore metadata: name: eclipse-che-restore namespace: eclipse-che spec: backupServerConfigRef: backup-server-configuration (1) snapshotId: <snapshot_id> (2)
1 Name of the CheBackupServerConfiguration
object that defines what backup server to use. You can find this name asbackupServerConfigRef
inspec
of theCheClusterBackup
custom object. (You can also find it asname
inmetadata
of theCheBackupServerConfiguration
custom object used to take the backup snapshot you are restoring.)2 Optional parameter defining the Snapshot ID to restore from. The default value is the last snapshot in the backup repository on the backup server. To reuse a
name
forCheClusterRestore
custom objects, first delete any existing custom object with the samename
. To delete it on the command line, use kubectl:$ kubectl delete CheClusterRestore <name> -n eclipse-che
-
Read the
status
section of theCheClusterRestore
object to monitor the recovery process, for example:status: message: 'Restore is in progress. Start time: <timestamp>' (1) stage: Restoring Che related cluster objects (2) state: InProgress (3)
1 Overall state or error message; for example, Restore successfully finished
.2 Current phase of the recovery process in a human-readable format. 3 Recovery process state. One of InProgress
,Succeeded
, orFailed
. -
Check that the Che instance has been recovered.
If errors occur in your browser after the recovery, clean up the browser data for the Che domain. -
Delete the
CheClusterRestore
object.
Restoring a Che instance from a backup by using chectl
Using chectl
, you can restore a Che instance from a backup snapshot by using any of the following options (as applicable):
Restoring a Che instance from its latest backup by using chectl
To restore the Che instance from its latest backup by using chectl
, you can enter latest
as the snapshot ID.
Backup snapshots are bound to a Kubernetes or OpenShift cluster. To restore a Che instance, you must only use a backup snapshot that was created in the same Kubernetes or OpenShift cluster. |
If the backup snapshot was taken in an earlier version of Che, add the --version=<earlier_version_number> option to the chectl server:restore command to roll back Che to that earlier version.
|
-
Installed
chectl
. -
Backup snapshot of a Che instance on any of the following:
-
Run the
chectl server:restore
command with the following arguments:$ chectl server:restore \ --snapshot-id=latest \ (1) --repository-url=<repository-url> \ (2) --repository-password=<repository-password> (3)
1 The latest snapshot. 2 The backup repository URL as an argument using the --repository-url
or-r
option. (Omit if using the internal backup server!)3 The backup repository password as an argument using the --repository-password
or-p
option. (Omit if using the internal backup server!)Last used backup server information is stored in a Secret inside the Che cluster. When consistently using the same backup server, you can enter the --repository-url
and--repository-password
options with thechectl server:backup
command just once and omit them onward when enteringchectl server:backup
orchectl server:restore
. -
When prompted in the output, enter
y
to confirm:... ✔ Snapshot: ... Asking for restore confirmation: Do you want to proceed? [y/n] ...
To skip this question, add the --batch
option to theserver:restore
command. -
Verify the output of the entered command. For example:
... ✔ Scheduling restore...OK ✔ Waiting until restore process finishes...OK Command server:restore has completed successfully in 05:59.
Restoring a Che instance from a backup by snapshot ID
To restore a Che instance from a particular backup snapshot, you can enter the snapshot ID with chectl
.
Backup snapshots are bound to a Kubernetes or OpenShift cluster. To restore a Che instance, you must only use a backup snapshot that was created in the same Kubernetes or OpenShift cluster. |
If the backup snapshot was taken in an earlier version of Che, add the --version=<earlier_version_number> option to the chectl server:restore command to roll back Che to that earlier version.
|
-
Installed
chectl
. -
Backup snapshot of a Che instance on any of the following:
-
Backup snapshot ID, which can be found in:
-
Command-line output when creating a backup
-
status
of aCheClusterBackup
custom object -
Command-line output of the Restic command that can list snapshots in the backup repository
-
-
Run the
chectl server:restore
command with the backup snapshot ID specified using the--snapshot-id=
option:$ chectl server:restore \ --snapshot-id=<snapshot-id> \ (1) --repository-url=<repository-url> \ (2) --repository-password=<repository-password> (3)
1 The snapshot ID. 2 The backup repository URL as an argument using the --repository-url
or-r
option. (Omit if using the internal backup server!)3 The backup repository password as an argument using the --repository-password
or-p
option. (Omit if using the internal backup server!)Last used backup server information is stored in a Secret inside the Che cluster. When consistently using the same backup server, you can enter the --repository-url
and--repository-password
options with thechectl server:backup
command just once and omit them onward when enteringchectl server:backup
orchectl server:restore
. -
When prompted in the output, enter
y
to confirm:... ✔ Snapshot: ... Asking for restore confirmation: Do you want to proceed? [y/n] ...
To skip this question, add the --batch
option to theserver:restore
command. -
Verify the output of the entered command. For example:
... ✔ Scheduling restore...OK ✔ Waiting until restore process finishes...OK Command server:restore has completed successfully in 05:59.
Restoring a Che instance by using chectl and a CheClusterBackup custom object
You can restore a Che instance by entering the name of the CheClusterBackup
custom object as an argument with the chectl server:restore
command.
If the backup snapshot was taken in an earlier version of Che, then chectl server:restore --backup-cr-name=<name_of_custom_object> rolls back Che to that earlier version, which is specified in the CheClusterBackup custom object.
|
-
Installed
chectl
. -
The
CheClusterBackup
custom object that was used to create the backup snapshot. -
The backup snapshot that was taken using the
CheClusterBackup
custom object and stored on any of the following:
-
Run the following command on a command line:
$ chectl server:restore \ --backup-cr-name=<name_of_custom_object> (1)
1 The name of the CheClusterBackup
custom object. -
When prompted in the output, enter
y
to confirm:... Asking for restore confirmation: Do you want to proceed? [y/n] ...
To skip this question, add the --batch
option to theserver:restore
command. -
Verify the output of the entered command. For example:
... ✔ Scheduling restore...OK ✔ Waiting until restore process finishes...OK Command server:restore has completed successfully in 05:59.