I have just gone through the process of moving my installation from v30 on Ubuntu 14.04 to v52 on Ubuntu 18.04. I recovered my backups successfully and mail seems be to flowing ok. However, I got a notification today saying that the backup had failed:
No such file or directory: ‘/home/user-data/backup/secret_key.txt’
Sounds like you are missing an encryption key for your backups. This file is created during setup, so running sudo mailinabox again should fix your situation.
I have tried running sudo mailinabox a couple of times and it doesn’t create the backup and encryption directories under user-data and neither does it create the encryption key.
Sorted! When I compared nextcloud.sh with the git version lines 27 and 28 were different. I edited my version to be the same and re-ran sudo mailinabox. Now I have a backup directory!