<p>I have a k8s cluster which uses rancher.io/local-path.
There is a PV there</p>
<pre><code>
    $ kubectl describe pv pvc-979af6ff-3617-4707-8a2c-b6c4ac00043f
    Name:              pvc-979af6ff-3617-4707-8a2c-b6c4ac00043f
    Labels:            &lt;none&gt;
    Annotations:       pv.kubernetes.io/provisioned-by: rancher.io/local-path
    Finalizers:        [kubernetes.io/pv-protection]
    StorageClass:      local-path
    Status:            Bound
    Claim:             gitlab/gitlab-prometheus-server
    Reclaim Policy:    Delete
    Access Modes:      RWO
    VolumeMode:        Filesystem
    Capacity:          8Gi
    Node Affinity:     
      Required Terms:  
        Term 0:        kubernetes.io/hostname in [agent-1]
    Message:           
    Source:
        Type:          HostPath (bare host directory volume)
        Path:          /var/lib/rancher/k3s/storage/pvc-979af6ff-3617-4707-8a2c-b6c4ac00043f_gitlab_gitlab-prometheus-server
        HostPathType:  DirectoryOrCreate
    Events:            &lt;none&gt;

</code></pre>
<p>I would like to move that PV to another node, agetn-5. How can I achieve that?
Important point that PV in question is <code>rancher.io/local-path</code> provisioned.</p>

Alex_www
<p>It isn't possible to do this in a single step.</p>
<p>But you can:</p>
<ol>
<li>Access the K8s cluster where PVC exists</li>
<li>Create a Deployment (or single Pod) that mounts PVC on the path you prefer (Example /xyz)</li>
<li>Run</li>
</ol>
<pre><code>   kubectl -n NAMESPACE cp POD_NAME:/xyz /tmp/
</code></pre>
<p>to locally copy the contents of the /xyz folder to the /tmp path</p>
<ol start="4">
<li><p>Logout from K8s cluster</p>
</li>
<li><p>Login to the K8s cluster where data will be migrated</p>
</li>
<li><p>Create new PVC</p>
</li>
<li><p>Create a Deployment (or Single Pod) that mounts the PVC on the path you prefer (Example /new-xyz)</p>
</li>
<li><p>Run</p>
</li>
</ol>
<pre><code>   kubectl -n NAMESPACE cp /tmp/xyz/ POD_NAME:/new-xyz/
</code></pre>
<p>to copy the local content to the path /new-xyz</p>
