BCDevOps / OpenShift4-Migration

Scripts and info for Ministry teams migration from OpenShift 3.11 to 4.x
Apache License 2.0
3 stars 0 forks source link

How do I move data between clusters? #60

Closed jleach closed 2 years ago

jleach commented 3 years ago

OpenShift 4.5+ (Silver Cluster) comes with an image openshift/cli in the openshift namespace. You can spin one up on the Silver cluster, oc logon to the Pathfinder (3.11) cluster, and then do commands like oc rsync to copy data from Pathfinder to a PVC mounted on your openshift/cli Pod.

The command below will help you get started. If you don't want the pod to be deleted when it exits remove the argument --rm=true or set it to --rm=false.

oc run -i -t mycli \
--image=image-registry.openshift-image-registry.svc:5000/openshift/cli:latest \
--restart=Never \
--command=true \
--rm=true \
-- /bin/bash

Once the pod is started you can export HOME=/tmp and then oc login as normal.

ProTip You can use this container for other things like CronJobs, etc.

jefkel commented 3 years ago

For some templates and step by step samples for copying data between clusters, head on over to the BCDevOps/StorageMigration/CrossClusterDataSteps walkthrough in the StorageMigration repo.

The walkthrough includes templates to build and deploy a migration pod (that mounts your PVC), as well as how to run an oc rsync from a pod in Cluster A to a pod in Cluster B.