Skip to content

Commit 4f678c3

Browse files
authored
Merge pull request #27373 from apinnick/MIG412-mtc-migration-rollback
MIG-412: MTC migration rollback (1.4.0)
2 parents 1368c0b + a482ec3 commit 4f678c3

File tree

7 files changed

+107
-113
lines changed

7 files changed

+107
-113
lines changed

migration/migrating_3_4/troubleshooting-3-4.adoc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,15 @@ include::modules/migration-using-mig-log-reader.adoc[leveloffset=+1]
2020
include::modules/migration-downloading-logs.adoc[leveloffset=+1]
2121
include::modules/migration-updating-deprecated-gvks.adoc[leveloffset=+1]
2222
include::modules/migration-error-messages.adoc[leveloffset=+1]
23-
include::modules/migration-manually-rolling-back-migration.adoc[leveloffset=+1]
23+
24+
[id="rolling-back-migration_{context}"]
25+
== Rolling back a migration
26+
27+
You can roll back a migration by using the {mtc-short} web console or the CLI.
28+
29+
include::modules/migration-rolling-back-migration-web-console.adoc[leveloffset=+2]
30+
include::modules/migration-rolling-back-migration-cli.adoc[leveloffset=+2]
31+
2432
include::modules/migration-using-must-gather.adoc[leveloffset=+1]
2533
include::modules/migration-known-issues.adoc[leveloffset=+1]
26-
2734
:!migrating-3-4:

migration/migrating_4_1_4/troubleshooting-4-1-4.adoc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ toc::[]
88

99
You can view the {mtc-full} ({mtc-short}) custom resources and download logs to troubleshoot a failed migration.
1010

11-
If the application was stopped during the failed migration, you must roll it back manually in order to prevent data corruption.
11+
If the application was stopped during the failed migration, you must roll back the migration in order to prevent data corruption.
1212

1313
[NOTE]
1414
====
@@ -19,7 +19,15 @@ include::modules/migration-viewing-migration-crs.adoc[leveloffset=+1]
1919
include::modules/migration-using-mig-log-reader.adoc[leveloffset=+1]
2020
include::modules/migration-downloading-logs.adoc[leveloffset=+1]
2121
include::modules/migration-error-messages.adoc[leveloffset=+1]
22-
include::modules/migration-manually-rolling-back-migration.adoc[leveloffset=+1]
22+
23+
[id="rolling-back-migration_{context}"]
24+
== Rolling back a migration
25+
26+
You can roll back a migration by using the {mtc-short} web console or the CLI.
27+
28+
include::modules/migration-rolling-back-migration-web-console.adoc[leveloffset=+2]
29+
include::modules/migration-rolling-back-migration-cli.adoc[leveloffset=+2]
30+
2331
include::modules/migration-using-must-gather.adoc[leveloffset=+1]
2432
include::modules/migration-known-issues.adoc[leveloffset=+1]
2533
:!migrating-4-1-4:

migration/migrating_4_2_4/troubleshooting-4-2-4.adoc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@ include::modules/migration-viewing-migration-crs.adoc[leveloffset=+1]
1919
include::modules/migration-using-mig-log-reader.adoc[leveloffset=+1]
2020
include::modules/migration-downloading-logs.adoc[leveloffset=+1]
2121
include::modules/migration-error-messages.adoc[leveloffset=+1]
22-
include::modules/migration-manually-rolling-back-migration.adoc[leveloffset=+1]
22+
23+
[id="rolling-back-migration_{context}"]
24+
== Rolling back a migration
25+
26+
You can roll back a migration by using the {mtc-short} web console or the CLI.
27+
28+
include::modules/migration-rolling-back-migration-web-console.adoc[leveloffset=+2]
29+
include::modules/migration-rolling-back-migration-cli.adoc[leveloffset=+2]
30+
2331
include::modules/migration-using-must-gather.adoc[leveloffset=+1]
2432
include::modules/migration-known-issues.adoc[leveloffset=+1]
2533
:!migrating-4-2-4:

modules/migration-manually-rolling-back-migration.adoc

Lines changed: 0 additions & 99 deletions
This file was deleted.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Module included in the following assemblies:
2+
// * migration/migrating_3_4/troubleshooting-3-4.adoc
3+
// * migration/migrating_4_1_4/troubleshooting-4-1-4.adoc
4+
// * migration/migrating_4_2_4/troubleshooting-4-2-4.adoc
5+
6+
[id='migration-rolling-back-migration-cli_{context}']
7+
== Rolling back a migration from the CLI
8+
9+
You can roll back a migration by using the CLI.
10+
11+
If your application was stopped during a failed migration, you must roll back the migration in order to prevent data corruption in the persistent volume.
12+
13+
Rollback is not required if the application was not stopped during migration because the original application is still running on the source cluster.
14+
15+
.Procedure
16+
17+
. Create a `MigMigration` CR object based on the following example:
18+
+
19+
[source,yaml]
20+
----
21+
$ cat << EOF | oc apply -f -
22+
---
23+
apiVersion: migration.openshift.io/v1alpha1
24+
kind: MigMigration
25+
metadata:
26+
labels:
27+
controller-tools.k8s.io: "1.0"
28+
name: migration-rollback
29+
namespace: openshift-migration
30+
spec:
31+
# 'canceled: true' cancels the migration
32+
canceled: false
33+
# 'rollback: true' rolls back the migration
34+
rollback: true
35+
# 'stage: true' runs a stage migration without quiescing the application on the source cluster.
36+
stage: false
37+
# 'quiescePods: true' scales the pods on the source cluster to '0' after the 'Backup' stage of a migration has finished
38+
quiescePods: false
39+
# 'keepAnnotations: true' retains the labels and annotations applied by the migration
40+
keepAnnotations: false
41+
42+
migPlanRef:
43+
name: <migplan-name> <1>
44+
namespace: openshift-migration
45+
EOF
46+
----
47+
<1> Specify the name of the migration plan that you want to roll back.
48+
49+
. In the {mtc-short} console, verify that the migrated project resources have been removed from the target cluster.
50+
. Verify that the migrated project resources are present in the source cluster and that the application is running.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Module included in the following assemblies:
2+
// * migration/migrating_3_4/troubleshooting-3-4.adoc
3+
// * migration/migrating_4_1_4/troubleshooting-4-1-4.adoc
4+
// * migration/migrating_4_2_4/troubleshooting-4-2-4.adoc
5+
6+
[id='migration-rolling-back-migration-web-console_{context}']
7+
= Rolling back a migration in the {mtc-short} web console
8+
9+
You can roll back a migration by using the {mtc-full} ({mtc-short}) web console.
10+
11+
If your application was stopped during a failed migration, you must roll back the migration in order to prevent data corruption in the persistent volume.
12+
13+
Rollback is not required if the application was not stopped during migration because the original application is still running on the source cluster.
14+
15+
.Procedure
16+
17+
. In the {mtc-short} web console, click *Migration plans*.
18+
. Click the Options menu {kebab} beside a migration plan and select *Rollback*.
19+
. Click *Rollback* and wait for rollback to complete.
20+
+
21+
In the migration plan details, *Rollback succeeded* is displayed.
22+
23+
. Verify that rollback was successful in the {product-title} web console of the source cluster:
24+
25+
.. Click *Home* -> *Projects*.
26+
.. Click the migrated project to view its status.
27+
.. In the *Routes* section, click *Location* to verify that the application is functioning, if applicable.
28+
.. Click *Workloads* -> *Pods* to verify that the pods are running in the migrated namespace.
29+
.. Click *Storage* -> *Persistent volumes* to verify that the migrated persistent volume is correctly provisioned.

modules/migration-running-migration-plan-cam.adoc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@
99

1010
You can stage or migrate applications and data with the migration plan you created in the {mtc-full} ({mtc-short}) web console.
1111

12-
.Prerequisites
13-
14-
The {mtc-short} web console must contain the following:
15-
16-
* Source cluster
17-
* Target cluster
18-
* Replication repository
19-
* Valid migration plan
20-
2112
.Procedure
2213

2314
. Log in to the source cluster.

0 commit comments

Comments
 (0)