<p>I am running JupyterHub on Google Cloud VM but due to some reasons I am not able to access JupyterHub running on VM now. Rather than resolving the issue with current JupyterHub I wanted to migrate JupyterHub on our Google Kubernetes Engine, so I installed another JupyterHub on Google Kubernetes Engine using <code>zero-to-jupyterhub-k8s</code>.</p>
<p>Now everything is running fine but I want to migrate the data saved on the old JupyterHub VM to my new JupyterHub. The new JupyterHub using Persistent Volume claims as storage for each of the pods of users. Could someone please let me know how can I do it?</p>

tank
<p>Posting this answer as a community wiki for a better visibility as well to add some additional resources that could help when encountered with similar scenario.</p>
<p>The issue portrayed in the question was resolved by copying user data to GCS bucket and then mounting the data to the user pods as posted in the comment:</p>
<blockquote>
<p>I solved this issue by copying the data from the VM to Google Cloud Storage and then mounted the GCS Bucket on the user pods in JupyterHub on Google Kubernetes Engine.</p>
</blockquote>
<p>The guide for installing <code>zero-to-jupyterhub-k8s</code>:</p>
<ul>
<li><em><a href="https://zero-to-jupyterhub.readthedocs.io/en/latest/google/step-zero-gcp.html" rel="nofollow noreferrer">Zero-to-jupyterhub: GKE cluster provisioning</a></em></li>
<li><em><a href="https://zero-to-jupyterhub.readthedocs.io/en/latest/setup-jupyterhub/index.html" rel="nofollow noreferrer">Zero-to-jupyterhub: Jupyterhub installation</a></em></li>
</ul>
<p>Resources on mounting GCS bucket to the Kubernetes pod:</p>
<ul>
<li><em><a href="https://github.com/maciekrb/gcs-fuse-sample" rel="nofollow noreferrer">Github.com: Maciekrb: gcs-fuse-sample</a></em></li>
<li><em><a href="https://karlstoney.com/2017/03/01/fuse-mount-in-kubernetes/" rel="nofollow noreferrer">Karlstoney.com: Fuse mount in Kubernetes</a></em></li>
</ul>
<hr />
<p>Citing the Github page:</p>
<blockquote>
<p><strong>Disclaimer!</strong></p>
<p>The big catch is that for this to work, the container has to be built with gcsfuse. The Dockerfile includes a base build for debian jessie.</p>
</blockquote>
<blockquote>
<p>The most note worthy parts of the configuration are the following:</p>
<pre class="lang-yaml prettyprint-override"><code>securityContext:
 privileged: true
 capabilities:
   add:
     - SYS_ADMIN
</code></pre>
<p>For the container to have access to /dev/fuse it has to run with SYS_ADMIN capabilities.</p>
<pre class="lang-yaml prettyprint-override"><code>lifecycle:
 postStart:
   exec:
     command: [&quot;gcsfuse&quot;, &quot;-o&quot;, &quot;nonempty&quot;, &quot;test-bucket&quot;, &quot;/mnt/test-bucket&quot;]
 preStop:
   exec:
     command: [&quot;fusermount&quot;, &quot;-u&quot;, &quot;/mnt/test-bucket&quot;]
</code></pre>
</blockquote>
