mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
42 lines
1.3 KiB
Plaintext
42 lines
1.3 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * migrating_from_ocp_3_to_4/troubleshooting-3-4.adoc
|
|
// * migration-toolkit-for-containers/troubleshooting-mtc
|
|
|
|
[id="migration-rolling-back-migration-cli_{context}"]
|
|
== Rolling back a migration from the CLI
|
|
|
|
You can roll back a migration by creating a `MigMigration` custom resource (CR) from the CLI.
|
|
|
|
If your application was stopped during a failed migration, you must roll back the migration to prevent data corruption in the persistent volume.
|
|
|
|
Rollback is not required if the application was not stopped during migration because the original application is still running on the source cluster.
|
|
|
|
.Procedure
|
|
|
|
. Create a `MigMigration` CR based on the following example:
|
|
+
|
|
[source,yaml]
|
|
----
|
|
$ cat << EOF | oc apply -f -
|
|
apiVersion: migration.openshift.io/v1alpha1
|
|
kind: MigMigration
|
|
metadata:
|
|
labels:
|
|
controller-tools.k8s.io: "1.0"
|
|
name: migration-rollback
|
|
namespace: openshift-migration
|
|
spec:
|
|
...
|
|
rollback: true
|
|
...
|
|
migPlanRef:
|
|
name: <migplan_name> <1>
|
|
namespace: openshift-migration
|
|
EOF
|
|
----
|
|
<1> Specify the name of the associated `MigPlan` CR.
|
|
|
|
. In the {mtc-short} web console, verify that the migrated project resources have been removed from the target cluster.
|
|
. Verify that the migrated project resources are present in the source cluster and that the application is running.
|