Restore share link - is it possible?

Hello,

I made a bone-headed move and removed a folder from my nextcloud that was being used to secure drop files. We had the hyperlink in our instruction guide for uploaded that we sent out to everyone that would upload files there.

Is there a way to restore that specific folder link? I tried to reupload the folder with the same name but it’s generating a new link. Am I pooched here?

Thanks!

Why not just set up a redirect on your server? You don’t need the old link to work again, just make it redirect to the new one.

For Apache:

Redirect 301 /OLD_SHARING_LINK https://NEXTCLOUD_SERVER.TLD/NEW_SHARING_LINK

For Nginx:

location /OLD_SHARING_LINK {
  return 301 https://NEXTCLOUD_SERVER.TLD/NEW_SHARING_LINK;
}
2 Likes

You’re a prince amongst men!

Hi Tom

I have installed new version of nextcloud and lost all the shared files, which I had to upload them again. Now the sharing links of previous shared files are not working any more, of course.

I have find your solution, but as my knowledge of nextcloud is poor, I would like to know, where I must put this line: Redirect 301 /OLD_SHARING_LINK https://NEXTCLOUD_SERVER.TLD/NEW_SHARING_LINK?

Where can I find old sharing links?

Regards

Mitja

I have installed new version of nextcloud and lost all the shared files, which I had to upload them again.

Hi Mitja, an upgrade should not cause data loss so that’s the first thing to troubleshoot. However if you re-installed instead of upgrading, then yes the data is lost because you installed it over the prior install.

I would like to know, where I must put this line: Redirect 301 /OLD_SHARING_LINK https://NEXTCLOUD_SERVER.TLD/NEW_SHARING_LINK?

The examples I supplied go on your server config. For Apache, it is the VirtualHost file for your site (probably in /etc/apache2/ somewhere). For Nginx it’s in the server block for your website. If it’s your server you should refer to the web server documentation and if you are using shared hosting try opening a support ticket with the hosting provider.

Where can I find old sharing links?

Those links were stored in Nextcloud’s database. If you upgraded they’re still there and should work. If you re-installed then that data is lost.

I don’t use Nextcloud any more so I’m afraid I have no further advice, but your best bet is to focus on what happened when you “installed new version of nextcloud and lost all the shared files”, because that’s what you need to undo. Something went wrong and when you discover what that was, the way forward will become clear. Good luck.