Recommended method to move files around on Nextcloud?

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • Nextcloud Hub 25 Autumn (32.0.3)
  • PHP version (e.g, 8.3):
    • 8.3.29
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

I have a large amount of files (photos/videos/etc) spread across a couple of different paths. Think …/files/Photos/2020,2021,2022,etc and …/files/Pictures/2019,2020,2021

I simply want to merge them into one giant folder and wonder what the most efficient way to do this is.

I have the Nextcloud desktop sync client running, which has synced everything to to desktop. I also have the Android app, the web version, WebDAV access, and SSH directly to the server. (I think that’s all of the ways to access Nextcloud, but if there’s a better way for this, let me know.)

  1. If I just rearrange everything locally on my desktop and let the sync client take care of things, will this just cause everything to re-upload to the server in the new location?

  2. If I move everything through the WebDAV network location, or through the web client, would that cause the opposite and everything will re-download to my desktop?

It’s not a huge amount of files and I’m sure any method would work. But I would like to know the recommended method of rearranging large amounts of data like this. And ideally reduce the time, SSD wear, and upload traffic spent.

I would do it using the webdav-Mount. So the moving of files is done on Server. Any download from Server is faster as any upload to server. And at least the Linux-Client will not download all moved files to the new folder and delete the files in old folder, but just move them from old to new. No idea what Win- or Mac-Clients would do.

Thanks, that is what I was leaning towards. I just wasn’t sure if the desktop client (I am using Linux) would move things or re-download everything again.

I’ll do I quick test with a couple of files to confirm, but this seems like it should be the best option :+1:

After a little bit of testing, some further questions arise:

I tried using mv command to move some files across but it seems as though this isn’t good for merging folders.

So I tried using cp -a and rsync -a and while both kinda work, both returned errors for each file copied:

rsync: [receiver] mkstemp “/run/user/1000/gvfs/dav:host=example,ssl=true,user=user,prefix=%2Fremote.php%2Fwebdav/Photos/test/09/.VID_20190920_094318.mp4.bjJQQW” failed: Operation not supported (95)

cp: preserving times for ‘/run/user/1000/gvfs/dav:host=example,ssl=true,user=joey,prefix=%2Fremote.php%2Fwebdav/Photos/2019/IMG-20190112.jpg’: Operation not supported

It seems as though WebDAV doesn’t support preserving timestamps (and I’m not sure what other metadata, but I’d like to keep it all if possible)

The web version does let me move folders, but it seems to overwrite everything in the destination so is no good for merging (unless I’m doing it wrong)

Edit: it looks like I can copy files between folders on the web UI, which preserves everything. But I have to do it folder by folder which is a shame…

I can also copy and paste folders using my GUI file browser, which works as expected, but takes a long time as it is writing new files to the disk before I have to delete the old ones manually, and then the Nextcloud sync client thinks the files are new, so re-downloads everything

I realise this is getting out of scope for Nextcloud support, but if anyone has any ideas to easily merge multiple folders while preserving metadata I’d love to try them out.

If you want to move, I’d rather use cut and paste.

For command line, you could try cadaver, if not perhaps with rclone? And if it is just a few files, I’d even try a cut and paste with the Nextcloud client. If there are not many, you’ll see if it keeps track.

Sorry but on my Setup a cp -a or rsync -a works.

Edit: did you install the Nextcloud Temporary files lock app (files_lock)?