Deleted users and shared links are gone - process to recover from backup

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


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:

Nextcloud version (eg, 20.0.5): 26
Operating system and version (eg, Ubuntu 20.04): ubuntu 22.04 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.46
PHP version: 8.1

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

Hi everybody,
Yesterday we moved our user authentication from local to Active Directory.
Once done, we removed the local users but forgot about their shared links.
We have some backups of the server, any chances to extract and injct the lost datas ?
What would be the process ?
And what if I recreate the exact same user/password we deleted ?

Thanks for your help

The data of the users is normally e.g. in /path/to/nextcloud/data/username/files
The other data e.g. shared links are in the database e.g. MariaDB.

Please read Restore.

Is it possible that you go back before you migrate to Active Directory?
Maybe you can restore the data to a test server and give all access to the test server for manual migration.

The question may be, which is better or worse:

  • back to the time before Active Directory migration
  • ask all user to add all Nextcloud data manually again and inform e.g. other people for links

Maybe it is also possible to extract parts from the database e.g. only shared links.
I think but for this you need certain Nextcloud knowledge.

Thanks for answering,

That was my guess. restore old nextcloud, extract databases and import to knew one.
Folders from old users are gone but that is not an issue as we migrated them before.
Only a bunch of shared links need to be recovered.


Ok, so I checked the table: oc_share and it looks like all the links are still there but links are not pointing to the shared files. Any idea ?