The MySQL Import is running fine wihtout any errors.
If im running the following command on Nextcloud OCC
sudo -u apache occ files:scan --all
The imported mysql entries from the backup are getting deleted in my mysql database.
Is there any chance to get the shared folders back?
Next problem I found:
If we are sharing now folders on the Nextcloud 18.0.3 release we just can add 10 users to the share…not more.
How did you upgrade with PHP 7.1 to 18.0.x. You should have seen an error, like “This version of Nextcloud requires at least PHP 7.2 You are currently running 7.1…”, no? But nonetheless this is probably not the cause of the issue.
Also since those steps in the linked issue worked for those guys and not for you perhaps it is something else?
Looking at the code base, the only thing I can see that would account for these rows being deleted in an upgrade to 18.0.3 is DeleteOrphanedSharesJob which will delete rows without a corresponding fileid in oc_filecache. If the cache was truncated and rebuilt from data directory at some point during or after upgrade for whatever reason then maybe this could happen? What about including oc_filecache in the process you are trying above?
To confirm if maybe this is the issue, you can also look at the oc_filecache.fileid vs imported oc_share.file_source in the DB and/or turn debugging on config ('loglevel' => 0) then look in log for anything around DeleteOrphanedSharesJob.
If this isn’t issue the debugging may give more of a hint? I’m not sure. Hopefully this helps otherwise maybe someone else will have an idea.