1.1 KiB
1.1 KiB
- the namespace will be the namespace for your target application
- run the application you need
- wait for its PVs to be created
- suspend the application:
kubectl scale deployment/statefulset/... NAME -n NAMESPACE --replicas=0 - wait for it to scale down so that the ReadWriteOnce PVs are released (or data-migrate will not be able to mount them)
- look up the destination PVC name you need:
kubectl get pvc NAME -n NAMESPACE - put the namespace, source host(node) and dir and destination PVC name to
install.yaml - install the data-migrate:
kubectl delete pod data-migrate -n NAMESPACE --ignore-not-found=true && kubectl apply -f install.yaml - run the migration:
kubectl exec data-migrate -n NAMESPACE -- cp -a /old/. /new/or anything you need instead ofcpor interactive shellkubectl exec -it data-migrate -n NAMESPACE -- sh(orbashorzsh) - validate you have everything migrated:
kubectl exec data-migrate -n NAMESPACE -- ls -laR /new - uninstall the data-migrate:
kubectl delete pod data-migrate -n NAMESPACE - resume the application back:
kubectl scale deployment/statefulset/... NAME -n NAMESPACE --replicas=1