How to restore Nextcloud Backup with server-side encryption?

Hi everyone,

we’re having some trouble restoring a backup of our old Nextcloud installation on a new server.

After following the official documentation, the files and database could be successfully restored (we can login and see users’ status messages and files), but none of the data can be accessed or created. There’s also a constant notification of:

Invalid private key for encryption app. Please update your private key password in your personal settings to recover access to your encrypted files.

Unfortunately, there doesn’t appear to be a GUI setting for “updating a private key”, just for changing the login password, which doesn’t do anything.

I figured this issue was caused by the config.php values 'instanceid', 'passwordsalt' and/or 'secret' changing between both installations, but whenever I try to set them to the old values or replace the whole config file/directory, the server becomes unreachable with an:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

I’m not sure how to regain access to the encrypted data and user folders. What’s the recommended way for restoring a backup when server-side encryption has been enabled within the app?

Is there anything else to try?

Kind regards!