Divyansh Jain

08/03/2023, 3:46 AM
Hi All, Is there any way to copy Databricks Notebook from Workspace to DBFS. Please help.

Christopher Grant

08/03/2023, 4:41 PM
i'm unsure if copying directly and in one step is possible, but in steps and using an intermediary should be fine. you can export a notebook, then upload the notebook to DBFS
would recommend using the new cli (version 0.200+)

Winston LAI

08/07/2023, 12:39 PM
Have you tried dbutils.fs.cp() to copy the path of the notebook and paste it to the DBFS destination path? If it doesn't work, then yeah I think Christopher's answer is what I would do, too. You may try his nice advice!
Great to hear that your problem has been resolved. Just for sharing, I found another potential solution as well. You can use the Databricks CLI to move a notebook from the workspace to DBFS. Here is an example command that you can use:
Copy code
databricks workspace export_dir /Users/ /mnt/my_mount_point/
This command exports the notebook
from the workspace directory
to the DBFS mount point
. You can replace
with the name of your notebook and
with the path to your notebook in the workspace. You can find more information about this command and other Databricks CLI commands in the [official documentation](

Divyansh Jain

08/07/2023, 1:11 PM
Thanks for sharing @Winston LAI!
👍 1