This page describes how to migrate data from an existing user-managed notebooks instance to a new one by using Cloud Storage.
When to migrate
You might need to migrate your data to a new user-managed notebooks instance if you can't upgrade the environment of your existing instance. See the requirements for upgrading the environment of a user-managed notebooks instance.
Before you begin
Create a Cloud Storage bucket in the same project where your user-managed notebooks instance is located.
Migrate your data to a new user-managed notebooks instance
To migrate data to a new user-managed notebooks instance by using Cloud Storage, complete the following steps.
In your user-managed notebooks instance's JupyterLab interface, select File > New > Terminal to open a terminal window.
gsutil toolto copy your user data to a Cloud Storage bucket. The following example command copies all of the files from your instance's
/home/jupyter/directory to a directory in a Cloud Storage bucket.
gsutil cp -R /home/jupyter/* gs://BUCKET_NAMEPATH
Replace the following:
BUCKET_NAME: the name of your Cloud Storage bucket
PATH: the path to the directory where you want to copy your files, for example:
In your new user-managed notebooks instance's JupyterLab interface, select File > New > Terminal to open a terminal window.
gsutil toolto restore your data on the new instance. The following example command copies all of the files from a Cloud Storage directory to the your new instance's
gsutil cp gs://BUCKET_NAMEPATH* /home/jupyter/
Learn more about using SSH access to connect to your user-managed notebooks instance.