cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Put file into volume within Databricks

lauraxyz
New Contributor III

Hi!  From a Databricks job, i want to copy a workspace file into volume.  how can i do that?

I tried

`dbutils.fs.cp("/Workspace/path/to/the/file", "/Volumes/path/to/destination")`
but got 
Public DBFS root is disabled. Access is denied on path: /Workspace/path/to/the/file
 
Is this the recommended way to put file into Volume?  prefer not to go with the API way for now.

 

2 REPLIES 2

Alberto_Umana
Databricks Employee
Databricks Employee

Hi @lauraxyz,

You can give it a try using: dbutils.fs.cp("file:/Workspace/path/to/the/file", "/Volumes/path/to/destination")

by adding "file:", i'm able to put File type into Volume, but for Notebook type, i would get following error:

ExecutionError: An error occurred while calling o460.cp. : java.io.FileNotFoundException: /Workspace/path/to/the/file (Operation not supported)

How does it work for Notebook type of file? I tried replace "file:" with "notebook:" or "Notebook:", neither works

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group