Moving back from Power Mail-in-a-Box to the official version

Hey,

We have been using Power Mail-in-a-Box for some time now because the official version wasn’t supporting Debian. As we upgraded our Infrastructure we are no longer limited to using Debian, and also Power Mail-in-a-Box was abandoned we would like to move back to the official version of MiaB. What would be the best way to do it without losing our emails?

Thanks for your help in advance!

Winux

I can think of a few ways, each with different goals. This is top of mind, you should try it out and see what you encounter on the way. I won´t guarantee this is complete or correct :wink:

If you only care about your mails:

  • Install a new Ubuntu server with the latest MiaB version, but keep your old box around, don´t yet move the DNS entries etc
  • Re-create all mail users (can be done programmatically using the API if there are many users)
  • Use something like imapsync to copy all mails to the new box.
  • Now disable postfix on old box, redo the imapsync step (should be fast because only new mails are transferred)
  • Move DNS to new box
  • Using this method you’re sure that your box is in sync with the official MiaB installation.

Another way:

  • Take a backup of your USERDATA
  • Install a new Ubuntu server with the latest MiaB version, but keep your old box around, don´t yet move the DNS entries etc. Use the recommende way to recover the backup
  • Now see if the box works as intended. There might be issues with the MiaB installation because power MIAB did things differently.
  • Fix the issues
  • If you’re satisfied with the installation, start again from the first step, but now move over the DNS etc as well. Consider the first time round as a dry run to see if it works
  • This way has the potential of costing less effort, however, there might be remains in your backup of the Power MiaB way of working that might hurt you in the future. Notably, there might be issues with the quota system, which might be different between the versions.
    This way also takes into account the stuff you have in nextcloud and other settings.

Perhaps @davness has something to say on the subject.

1 Like

Ive

Taken a backup of your /home/user-data

Step 1) Create a new virtual machine (droplet, VPS, compute ec2, etc) during that installation select ubuntu 22.04 as the operating system. DO NOT DELETE YOUR OLD SERVER

Step 2) copy your /home/user-data/ folder over to the new server, however which way you want to do this (duplicity backup/restore

tar -czvf user-data.tar.gz /home/user-data/ then moving that file via SCP and restoring with tar -xvf user-data.tar.gz
rsync, winscp, or other methods could be used for moving the file.

Step 3) install mail-in-a-box ( curl -s https://mailinabox.email/setup.sh | sudo bash ) command

Step 4) reconfigure your IP address to be that of the existing server you had previously. This is probably going to different for every service out there so you might have to google how to do this with whatever VPS cloud hosting company your using.

I’m pretty sure this will basically put you back to normal.


But essentially all of you mail is under /home/user-data/mail/mailboxes//
So even if this method doesn’t work, copying over the individual mailboxes would also work for restoring the mail in each users mailbox. However you might need to create the mailboxes first and log into each mailbox 1 time via webmail so the folder structure is created. Then the files in “cur” & “new” can be moved into each corresponding folder.

Imapsycn is free under 3GB but you can start all over and finish the move. This is a good way to keep the folder structure and when you move between providers MIAB to Proton, etc.

But the fastest way is to recreate users, aliases, custom dns entries, and then copy the USERDATA.

No need to use the backup method.

The ONLINE version is free for mailboxes under 3gb.

If you install your own on a vps, it is unlimited. Imapsync is in the repo’s.

1 Like

Hi,
Thanks for your reply! We will try to move the files

How did you make out?

We haven’t moved yet but it will be done in 2 weeks.