Put file into volume within Databricks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2024 03:08 PM
Hi! From a Databricks job, i want to copy a workspace file into volume. how can i do that?
I tried
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2024 04:29 PM
Hi @lauraxyz,
You can give it a try using: dbutils.fs.cp("file:/Workspace/path/to/the/file", "/Volumes/path/to/destination")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2024 09:02 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2024 04:50 AM
Let me try it on my end and get back, looks like we need to upload the destination location to a dbfs location first then a volumen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2024 12:33 PM
Found the reason! It's the runtime, it doesn't work on Databricks Runtime Version 15.4 LTS, but started to work after changing to 16.0. Maybe this is something supported from the latest version?

