Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing/updating an existing file #10

Open
atrisovic opened this issue Nov 9, 2021 · 2 comments
Open

Replacing/updating an existing file #10

atrisovic opened this issue Nov 9, 2021 · 2 comments

Comments

@atrisovic
Copy link

Hi there,

DVUploader won't detect that a file has changed unless I use the -verify flag.
However, when I use it, it sees and uploads the file as a new one instead of replacing (ie updating) an existing file. So the dataset will have a new text-1.txt file instead of updating the test.txt file.

Thanks!
Ana

@behinger
Copy link

behinger commented Feb 4, 2022

bump I have exactly the same issue. I wonder if there is an interaction with the versioning system - i.e. doesn't work in draft mode but works in published mode?

@qqmyers
Copy link
Member

qqmyers commented Feb 4, 2022

Unless I'm forgetting something, DVUploader doesn't currently understand that Dataverse has a replace function. It detects whether a file exists in the dataset already by path/name or, with -verify, by hash value and, if the local file is different, it uploads it, which then invokes Dataverse's renaming logic to avoid the conflict. It probably could use the replace API instead. Not sure if it should default to that though as replace in a draft version completely removes the old file which may not be intended - that could be addressed with another command line option though.

I'm not sure when this will be a priority (pull requests welcome) , but I can think of a few partial workarounds - you can detect the changes and use -listonly to not upload them and then manually address those files (either calling replace yourself or using the UI, or if you don't care about whether it is recorded as a file replacement, just deleting the file in Dataverse before reuploading with DVUploader).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants