How to copy PVC between different storage classes?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
Kubernetes does not have a built-in "move this PVC to another storage class" command. The practical solution is to create a new PVC with the target storage class, mount both the source and destination into a helper pod, copy the data, verify it, and then cut the workload over to the new claim.
Create the Destination PVC First
Start by creating a new PVC that uses the target storage class and has enough capacity:
This new claim is the destination volume. It does not migrate anything by itself.
Use a Helper Pod That Mounts Both PVCs
The common migration pattern is a pod with both claims mounted:
Once the pod is running, you can exec into it and copy the data.
Copy the Data Safely
A simple copy can be enough:
For larger or more sensitive migrations, rsync is often better because it preserves metadata more clearly and can be rerun incrementally:
The exact tool depends on what is available in the helper image and what metadata fidelity you need.
Think About Consistency Before Copying
The storage copy is easy. Application consistency is the harder part. If the source volume is still being written to while you copy it, the destination may be inconsistent.
Typical ways to handle this are:
- stop or scale down the writer workload
- put the application in maintenance mode
- use a snapshot-based workflow if the storage system supports it
If the data matters, consistency planning matters more than the copy command itself.
Verify Before Cutover
Do not switch the application immediately after copying without checking the result. At minimum:
- confirm file counts or directory structure
- spot-check important files
- verify ownership and permissions
- test the application against the new PVC
Only after verification should you update the workload to mount the new claim instead of the old one.
Cut Over the Workload
Once the new PVC is ready, change the deployment, StatefulSet, or other workload manifest to use target-pvc. Then bring the application back up and confirm it behaves correctly.
After that, keep the old PVC around until you are confident the migration succeeded. Deleting it immediately removes your easiest rollback path.
Common Pitfalls
- Expecting Kubernetes to migrate data automatically just because a new PVC uses a different storage class.
- Copying live data while the application is still writing to the source volume.
- Forgetting to verify permissions and ownership after the copy.
- Deleting the source PVC before testing the workload on the destination PVC.
- Ignoring access-mode and capacity differences between the old and new storage classes.
Summary
- Moving data between storage classes is usually a copy-and-cutover process, not an in-place PVC conversion.
- Create a destination PVC in the new storage class first.
- Mount both claims into a helper pod and copy the data.
- Plan for consistency before copying and verify before cutover.
- Keep the original PVC until the new one has been tested successfully.

