How to bulk edit extension of Uploaded Files in Nextcloud

So, I have 10,000 Files with the extension .zip.zip and I didn’t realize that earlier. Now, I can’t re-upload all the files, but I want to edit the .zip.zip to .zip as that’s what the extension should be!

Can I do that using some code or some database edit? Also, all the files are inside a folder, let’s call it Files321.

You could mount your instance via WebDAV and bulk rename the files with tools or a little bashscript?

I would definitely not recommend to directly perform any SQL statements.

I installed it using LAMP, so I guess it’s not an instance!!! Maybe, I’m not clear on that!

Edit - I just realized the word was SNAP, so it’s an instance only! Sorry, anyways can you PLEASE help me with what you said?

It doesn’t matter how you installed your Nextcloud instance (this is the server part). My response is valid with a Lamp setup as well as with a snap or any other setup.

Here is the documentation about how you can access your Nextcloud via WebDAV. This will allow you to access and rename your files without actually downloading it.

Also i think the default Nextcloud Desktop sync client supports the renaming operation without uploading each file again, so if you already are using the Desktop sync client and have synchronized all the files, just rename them. They won’t be uploaded from scratch again.

1 Like

Probably the best solution.

I could suggest another option but it would be as a last resort only.

Let me try this…

@mukeshwar
Do you have shell access to your nextcloud (linux user)?
Then you can rename all files in /path/to/nextcloud/data with one linux command and then re-scan your nextcloud with “occ”.

Yes, I’m on mac and all Linux commands work in Terminal.

You need terminal access to your server though for the suggestion of @devnull - or do you host your bextclouf server instance on your local machine?

Yes, I can connect using ssh root@ and also by FileZilla with SFTP…