Stupidly upgraded Ubuntu to 20.04

Without thinking, I went and upgraded my Ubuntu server that runs mail-in-a-box to 20.04. It still works, but I can no longer run any updates for Mail-in-a-box. I am trying to backup and restore my current data to a new Ubuntu Server 18.04 but I keep getting errors when doing so. Please help. I can’t get things to copy or run when using the privileges that are native, so when I open it up with a chmod 777 then I get other error messages. I am happy to start completely over with a fresh install of Ubuntu if that is what it takes to get things going. I am honestly stuck. Any assistance would be greatly appreciated.

ecnal@box:~$ sudo -E duplicity restore --force file:///encrypted /home/user-data/
gpg: WARNING: unsafe ownership on homedir ‘/home/ecnal/.gnupg’
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: none
Traceback (innermost last):
File “/usr/bin/duplicity”, line 87, in
File “/usr/bin/duplicity”, line 70, in with_tempdir
File “/usr/lib/python3/dist-packages/duplicity/”, line 1577, in main
File “/usr/lib/python3/dist-packages/duplicity/”, line 1660, in do_backup
File “/usr/lib/python3/dist-packages/duplicity/”, line 745, in restore
File “/usr/lib/python3/dist-packages/duplicity/”, line 767, in restore_get_patched_rop_iter
backup_chain = col_stats.get_backup_chain_at_time(time)
File “/usr/lib/python3/dist-packages/duplicity/”, line 1011, in get_backup_chain_at_time
raise CollectionsError(u"No backup chains found")
duplicity.dup_collections.CollectionsError: No backup chains found

How many users do you have / how much actual email data?
Are your users actively using Nextcloud?

I run this on a virtual machine. The entire virtual disk in 80GB and there is 20GB used. I have 11 total email addresses defined, but I only really use one of them. I don’t believe I am using Nextcloud at all, but I am not entirely certain. I pretty much only use this for email and I pretty much only use one email account. The /home/user-data/backup directory is 1.1GB.

Don’t waste your time. If you only have 10 mailboxes build up a new server from scratch and move your old emails to it, you’ll spend less time and have a more consistent status of your box.


@ecnal The absolute easiest thing for you to do at this point is to simply start over with a new MiaB install, but keeping your existing email data.

Where are you hosting your MiaB, with which provider?

What you want to do is to create a new MiaB instance with another VPS, then manually create the user accounts. Once you have the underlying accounts set up, use rsync to copy over the maildirs.

Then make a snapshot of the new server and reinstall it on the service of the old vps to retain your IP address.


I have my own virtualization server and I control all the IP space. Some of the perks of my profession.

So, create a new VM → Install Mail-In-A-Box → Recreate all the email accounts identically → copy over the directories from the old Mail-In-A-Box server.

Do you know what directories I need to rsync?

Thank you,


If you want to migrate only the mails use imapsync.

Or rsync the directories under /home/user-data/mail/mailboxes There is a directory for each one of your domains: keep ownership and group. If you built filters with roundcube rsync also /home/user-data/mail/roundcube. Keep an eye of sieve/ and spamassasin/ dirs, don’t remember if I rsynced them too.

It would be wise if you do a complete backup/restore procedure in another vm after you succesfully migrate your server, just to see that everything would be restorable correctly in the future and you got the new right backup encryption keys.

1 Like

That sounds straight forward enough. I will give it a shot this weekend and let you know how it went. Thanks for the help thus far, both of you. I really appreciate it.

Sorry it has taken me so long to reply. I built a new 18.04 VM, installed Mail-in-a-Box, stopped the service on both the old and new VMs, and then rsynced the /home/user-data/mail/mailboxes directory. I then swapped the IP addresses of the two VMs. When I started the services back up everything was there. I had a little bit of an issue getting the primary SSL certificate installed on the new VM, but eventually and inexplicably it installed, and now everything seems to be operating correctly. I do snapshots of the VM every night and those look good as well. Thank you for the help everyone. I really appreciate it. This issue is resolved.

1 Like