Backing up of Che instances to the internal backup server
To create backups for testing purposes, you can use the internal backup server. The internal backup server is a REST backup server that is managed by the Che Operator.
The Che Operator defaults to using the internal backup server for pre-update backups (to allow the Che version rollback) if multiple backup servers are configured and if the che.eclipse.org/backup-before-update: true annotation is added to more than one of the multiple backup servers or is not added to the custom object of any one of the multiple backup servers.
|
Backing up a Che instance to the internal server by using the CheClusterBackup custom object
You can create a custom object to back up a Che instance to the internal backup server.
In this case, the Che Operator automatically configures the internal backup server and creates a CheBackupServerConfiguration custom object with name: backup-rest-server-configuration .
|
Configuring a backup server inside the same cluster, for example the internal backup server, is not the best practice because a cluster failure can be one of the scenarios when a backed up Che instance needs to be restored. |
Procedure
-
Create the
CheClusterBackup
custom object to send a backup snapshot to the internal backup server:apiVersion: org.eclipse.che/v1 kind: CheClusterBackup metadata: name: eclipse-che-backup namespace: eclipse-che spec: useInternalBackupServer: true (1)
1 Configures the custom resource to back up to the internal backup server. -
Read the
status
section of theCheClusterBackup
object to verify the backup process:... status: message: 'Backup is in progress. Start time: <timestamp>' (1) stage: Collecting Che installation data (2) state: InProgress (3) ...
1 Displays the overall state or error message. 2 Current phase of the backup process in a human-readable format. 3 Backup process state: InProgress
orSucceeded
orFailed
.... status: cheVersion: 7.37.0 (1) message: >- (2) Backup successfully finished at 2021-10-07 11:18:28.116103737 +0000 UTC m=+2384.430366711 snapshotId: 40a09756 (3) state: Succeeded (4) ...
1 The version of Che from which the backup snapshot was created. This field appears only when state
isSucceeded
.2 Displays the overall state or error message. 3 The ID of the created backup snapshot. This field appears only when state
isSucceeded
.4 Backup process state: InProgress
orSucceeded
orFailed
.
Backing up a Che instance to the internal server by using chectl
You can use chectl to take a backup snapshot of a Che instance and send it to the internal backup server.
In this case, the Che Operator automatically configures the internal backup server and creates a CheBackupServerConfiguration custom object with name: backup-rest-server-configuration .
|
This procedure does not back up the source code stored in users' workspaces. To back up the source code stored in users' workspaces, see Backups of persistent volumes. |
Prerequisites
-
Installed
chectl
. -
Che has not been configured to use a backup server.
Procedure
-
On a command line, enter the
chectl server:backup
command with no arguments. -
Verify the output of the entered command. For example:
... ✔ Scheduling backup...OK ✔ Waiting until backup process finishes...OK Backup snapshot ID: 9f0adce2 Command server:backup has completed successfully in 00:10.