Shares created by email are missing after a transfer of ownership

I’m having an issue with the command “occ files:transfer-ownership”.

The files are all transfered correctly. The public shares are all restored correctly.
The problem is the shares by email are not restored at all.

If I transfer back the ownership to the original owner, the email shares are restored back.

Nextcloud version: 16.0.5
Operating system and version: Ubuntu 18.04.3
nginx version: 1.15.8
PHP version: 7.3.10

The issue you are facing:

Transfer ownership does not restore shares sent to email. Only public shares are restored.

Is this the first time you’ve seen this error?: Y

Steps to replicate it:

  1. run command occ files:transfer-ownership
  2. log in to userB account
  3. confirm shares are not restored

The output of your Nextcloud log in Admin > Logging:

[https://pastebin.com/HVz71G47](https://pastebin.com/HVz71G47)

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

    <?php
    $CONFIG = array (
      'lost_password_link' => 'disabled',
      'passwordsalt' => 'REMOVED',
      'secret' => 'REMOVED',
      'trusted_domains' =>
      array (
        0 => 'REMOVED',
        1 => 'REMOVED,
        2 => '',
      ),
      'datadirectory' => '/var/nc_data',
      'dbtype' => 'mysql',
      'version' => '16.0.5.1',
      'overwrite.cli.url' => 'REMOVED',
      'dbname' => 'nextcloud',
      'dbhost' => 'localhost',
      'dbport' => '',
      'dbtableprefix' => 'oc_',
      'mysql.utf8mb4' => true,
      'dbuser' => 'REMOVED',
      'dbpassword' => 'REMOVED',
      'installed' => true,
      'instanceid' => 'ocmb8p01x9c6',
      'activity_expire_days' => 14,
      'auth.bruteforce.protection.enabled' => false,
      'blacklisted_files' =>
      array (
        0 => '.htaccess',
        1 => '.lnk',
      ),
      'cron_log' => true,
      'enable_previews' => true,
      'enabledPreviewProviders' =>
      array (
        0 => 'OC\\Preview\\PNG',
        1 => 'OC\\Preview\\JPEG',
        2 => 'OC\\Preview\\GIF',
        3 => 'OC\\Preview\\BMP',
        4 => 'OC\\Preview\\XBitmap',
        5 => 'OC\\Preview\\Movie',
        6 => 'OC\\Preview\\PDF',
        7 => 'OC\\Preview\\MP3',
        8 => 'OC\\Preview\\TXT',
        9 => 'OC\\Preview\\MarkDown',
      ),
      'filesystem_check_changes' => 0,
      'filelocking.enabled' => 'true',
      'htaccess.RewriteBase' => '/',
      'integrity.check.disabled' => false,
      'knowledgebaseenabled' => false,
      'logtimezone' => 'Europe/Berlin',
      'log_rotate_size' => 104857600,
      'memcache.local' => '\\OC\\Memcache\\APCu',
      'memcache.locking' => '\\OC\\Memcache\\Redis',
      'preview_max_x' => 1024,
      'preview_max_y' => 768,
      'preview_max_scale_factor' => 1,
      'redis' =>
      array (
        'host' => '/var/run/redis/redis-server.sock',
        'port' => 0,
        'timeout' => 0.0,
      ),
      'quota_include_external_storage' => false,
      'share_folder' => '/Shares',
      'skeletondirectory' => '',
      'trashbin_retention_obligation' => 'auto, 7',
      'mail_from_address' => 'REMOVED',
      'mail_smtpmode' => 'smtp',
      'mail_sendmailmode' => 'smtp',
      'mail_domain' => 'REMOVED',
      'mail_smtphost' => 'REMOVED',
      'mail_smtpport' => '25',
      'ldapIgnoreNamingRules' => false,
      'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
      'maintenance' => false,
      'loglevel' => 2,
      'app_install_overwrite' =>
      array (
        0 => 'impersonate',
      ),
    );



The output of your Apache/nginx/system log in /var/log/____:

nothing shows up in the log