Nextcloud AIO is not the only way to run Nextcloud in docker. For example you can use the Nextcloud docker repository and docker-compose for which there are many examples. I've been running Nextcloud this way for many years now without any un-recoverable issues, and no issues at all that weren't caused by me. Upgrading is also very easy since you simply increment the version in docker-compose.yml and restart the service.
That said the NixOS suggestion from @StrawberryPigtails@lemmy.sdf.org looks really neat and I may try that out soon my self since I've never played with NixOS before and it seems like a good excuse to do so.
So, I'm not sure if the process has changed in the last decade or so but in a long-ago computer forensics class step 0, before all else, was to never operate data recovery on the original disk. Create a block level image of the entire device, then work on that.
My go to steps for recovery have been the following in the years since:
ddrescue -d /dev/sdX <path_to_image>.img
testdisk <path_to_image>.img
If the disk has a complicated partition layout, or more effort is required to find the correct partition you can also mount parts of the disk.
create an image of the entire disk (not a partition) using ddrescue
ddrescue -d /dev/sdX <path_to_image>.img
Mount the image as a loopback device with the appropriate offset
losetup --offset <some_offset_like_8192> --show -v -r -f -P <path_to_image>.img
this will mount individual partitions:Then operate testdisk on whatever partition you want.
All that said there are a lot of variables here and things don't always work perfectly. I hope you do find a way to recover them.