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: 

Move a folder from Workspace to DBFS

AChang
New Contributor III

So, I didn't quite set up my model training output directory correctly, and it saved all my model files to the workspace in the git repo I was working in. I am trying to move these files to DBFS, but when I try using dbutils.fs.mv, I get this error: 

java.io.FileNotFoundException: /Repos/$EMAIL/$FOLDER/output/checkpoint-13956/*

I have tried it without the *, tried it with and without a foward slash at the end, and I always get the same error. For the destination I am using "dbfs:/$FOLDER". I am trying to avoid downloading each file individually, and when I try to export the whole folder none of the options really work for me since these are not workbook files. Also, some of the files are just too large to download, so I think I will have to use some kind of code option.

1 ACCEPTED SOLUTION

Accepted Solutions

AChang
New Contributor III

Figured it out, just had to use the !cp command, here is what I did, worked perfectly.

!cp -r /Workspace/Repos/$RESTOFPATH /dbfs/folder
 
and it put the entire folder i was trying to move, into that dbfs folder.

View solution in original post

2 REPLIES 2

AChang
New Contributor III

Figured it out, just had to use the !cp command, here is what I did, worked perfectly.

!cp -r /Workspace/Repos/$RESTOFPATH /dbfs/folder
 
and it put the entire folder i was trying to move, into that dbfs folder.

Kaniz_Fatma
Community Manager
Community Manager

That’s a great tip! Thank you for sharing your knowledge with the community. I’m sure many people will find it helpful. Keep up the good work! 😊

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