Use old share link for new folder

Hello,

I use the recent stable nextcloud 16.0.3 and I face this problem:

A few month ago, I send a person an email with a sharing link (no login just the link to a folder on my nextcloud instance)
looking like this
https://url.tothecloud.com/index.php/s/yTkfjgY2eLQqwjK

now I changed the folder structures, and I would like to reassign the link I sent him via email to a specific folder. (so now when he clicks on it its not showing 404 error, but he can access the new folder)

How can I do that?

thanks

You can’t! Share links are the result of a hash function, probably with some other data mixed in. Usually, the link moves with the folder, though. So unless you didn’t remove the link - or did anything to the folder itself, which removes the link, the sharing link should still be active. If you somehow removed the folder and created a new one the old link will be gone for good.

I don’t know that this is possible.

It’s possible that you could implement a URL shortener to work around this problem in the future.

Oh yeah, you can do all things to the table… believe me. Once I had to write a little script to get false entries out of the table, or rather clean up the share table, where we had some zombies lying around, which the NC garbage collector wouldn’t catch.

If you can ditch your sharesm then you can also start over and even delete the contents of those tables, but that would wipe out all of your shares and that hadn’t been an option for us back then.

The relations are not that hard to follow, but oc_filecache is at the heart of the system.

Yes that’s corect - the link is still valid until it is deleted. It can be mover everywhere or renamed, it is still valid.