How to move DVC files

Search for this topic, I found this summary post but I cannot open the original question (discord tells me it cannot find it) so I’m creating a new topic. Apologies in advance.

I tried following the instructions given i.e. I ran

mv my_file.dvc dvc_links/my_file.dvc

and edited the working directory in the moved file.
However running dvc status gives

dvc_links/my_file.dvc:
        changed checksum

How do I get dvc to update the checksum in the relocated file? I even tried removing the md5: xx line at the top of the new file, calculating the md5 sum and reinserting it but this didn’t work.

1 Like

Try these steps:

rm my_file.dvc
dvc add -f dvc_links/my_file.dvc my_file

I think this is not documented and it is not obvious at all. I found it the hard way (by trial and error).

3 Likes

Thank you. This worked

@dashohoxha Thank you for your answer! :slight_smile:

@jcf76 This is a bug in dvc move a patch for which was merged today https://github.com/iterative/dvc/pull/2421 and will soon be released in a new dvc version. Thank you for the feedback! :slight_smile: