Skip to content

Commit

Permalink
Update restore docs to include new rollback feature
Browse files Browse the repository at this point in the history
Signed-off-by: Mykola Morhun <[email protected]>
  • Loading branch information
mmorhun committed Sep 30, 2021
1 parent 966aa53 commit 5ec90bc
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
* Backup snapshots are bound to their own specific cluster and must be used only there.
====

{prod} Operator creates a new backup on every {prod-short} update.
Depending on the xref:define-backup-server-for-operator.adoc[configuration], backups before {prod-short} update are stored in:

* The only configured backup server
* Backup server which configuration marked with `che.eclipse.org/backup-before-update: true` annotation if there is more than one configuration
* Internal backup server if no backup servers configured or configured several and `che.eclipse.org/backup-before-update: true` annotation missing

.Additional resources


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,43 @@ $ {prod-cli} server:backup --repository-url=__<repository-url>__ --repository-p
[id="cli-restoring-from-backup"]
== Restoring from a backup

. Recover the previous state of {prod-short}:
. Recover to the previous state of {prod-short}:
+
[source,shell,subs="+quotes,+attributes"]
----
$ {prod-cli} server:restore --repository-url=__<repository-url>__ --repository-password=__<repository-password>__
$ {prod-cli} server:restore --repository-url=__<repository-url>__ --repository-password=__<repository-password>__ --snapshot-id=__<snapshot-id>__
----

* The `server:restore` command can be run with no arguments when the backup server was used before.
* It is possible to omit `--repository-url` and `--repository-password` arguments for the `server:restore` command if the same backup server should be used.

. Recover from a specific snapshot by specifying its ID:
. Recover to different than exiting version of {prod-short}:
+
[source,shell,subs="+quotes,+attributes"]
----
$ {prod-cli} server:restore --snapshot-id=__<snapshot-id>__
$ {prod-cli} server:restore --version=__<version>__ --snapshot-id=__<snapshot-id>__
----
+
[NOTE]
====
Provided snapshot must be created from the version of {prod-short} to which recover is requested.
====

* If you have a dedicated backup repository for each {prod-short} version and want to use the most recent backup for the version,
you may provide `latest` as snapshot ID and it will be converted to the latest ID in the given repository.

. Recover to the state described by an existing backup Custom Resource object:
+
[source,shell,subs="+quotes,+attributes"]
----
$ {prod-cli} server:restore --backup-cr-name=__<CheClusterBackupCRName>__
----

. Recover to the previos version after update:
+
{prod} automatically creates a backup when upgrading to a newer version.
To return to the previos installed version run:
+
[source,shell,subs="+quotes,+attributes"]
----
$ {prod-cli} server:restore --rollback
----
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include::partial$snip_internal-backup-server-warning.adoc[]

* xref:setup-backup-server.adoc[Setting up a backup server].

* xref:define-backup-server-for-operator.adoc[Configuring {prod-cli} to use the backup server].
* xref:define-backup-server-for-operator.adoc[Configuring {prod} to use the backup server].

.Procedure

Expand Down Expand Up @@ -65,6 +65,12 @@ spec:
[id="operator-restoring-from-a-backup"]
== Restoring from a backup

[NOTE]
====
It is not possible to recover to a different version of {prod-short} using this approach.
To do it, use `{prod-cli}` (see xref:managing-backups-using-cli.adoc#cli-restoring-from-backup[here]).
====

. Create a new object of `CheClusterRestore` to recover a {prod-short} installation from a backup:
+
[source,yaml,subs="+attributes"]
Expand Down

0 comments on commit 5ec90bc

Please sign in to comment.