Nextcloud AIO did not restore Serverside encryption keys?

Hi, I’ve been having problems with my nextcloud instance. To make a long story short I restored a backup using the built in borg-backup tool from August 2024 and files that were encrypted using server side encryption are not unencrypting.

I had made a post on the Github Discussions of AIO and Simon had advised me to move the post here so more people could see it.
Here’s a summary of that post.

I noticed that some sort of encryption didn’t restore correctly, as I can no longer open any of my files. I downloaded one of the files I can’t open (a png) and opened it with a text editor and found this HBEGIN:oc_encryption_module:OC_DEFAULT_MODULE:cipher:AES-256-CTR:signed:true:useLegacyFileKey:false:encoding:binary:HEND, which I’m believe may be from server side encryption. I see this error in the logs. Error no app in context Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you. and running ls /ncdatadir/user/files_encryption/keys yields an empty directory. IIRC at some point I did try using the E2EE module, but shortly after trying it I found out I couldn’t use it with server side encryption and disabled it.

Please let me know what I can provide to help troubleshoot this issue. Most of what was lost is not super important, but it is mildly annoying.

To continue here, can you check if the SSE keys are part of the backup archive of the one that you tried to restore?

See GitHub - nextcloud/all-in-one: 📦 The official Nextcloud installation method. Provides easy deployment and maintenance with most features included in this one Nextcloud instance.

I’m looking now, and it appears that in both the root of the datadir /files_encryption, and within /{userxyz}/files_encryption that encryption keys are present. However, I think the backup I had restored from got overwritten by a backup taken right after restoration as I had restored one from July, and the one I’m looking at is from August. I can tell you that when I tried to restore this August backup previously that it had given me a “301 Permanently moved” nginx error, so I am not sure what to do from here. I’ll check and see if I have the July backup present on my backup drives and if I can check it to see if they are present there as well.