Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Update restore docs to include new rollback feature #2124

Merged
merged 15 commits into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
* 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.
If a backup server is xref:define-backup-server-for-operator.adoc[configured], then it is used to store the backup.
If no backup server configured, then internal backup server is used.
If there is more than one backup server configured, the server with `che.eclipse.org/backup-before-update: true` annotation is used.
If none have the annotation, then internal backup server is used.

.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.
MichalMaler marked this conversation as resolved.
Show resolved Hide resolved

. 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 previous version after update:
+
{prod} automatically creates a backup when upgrading to a newer version.
To return to the previous 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 impossible 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