Files
2026-07-20 21:23:28 +03:00
..
2026-07-20 21:23:28 +03:00
2026-07-20 21:23:28 +03:00

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