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)
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.
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.