I am in the process of migrating to a new 22.04 server (from 18.04). Built the new server. I took advantage of the opportunity to move the install folder to be off of the root (/mail-in-a-box). I used the command export STORAGE_ROOT=/your/desired/path.
When I try to restore my backup it all goes well except there are no mailboxes restored. Sad face.
Should I be able to restore to a “new” location - or is that my problem?
Is the new STORAGE_ROOT used for other settings? You can check /etc/mailinabox.conf for the current setting.
If it’s not set or used, you might need to do something like:
sudo su
export STORAGE_ROOT=/your/desired/path
./mailinabox/setup
This should make sure the exported variable is actually used by the setup script.
Note that I have not tested this, so check it carefully, and make sure you have backups.
Not sure what you’ve done but the DB restore is not really part of MIAB, so I doubt that the DB restore uses STORAGE_ROOT. Perhaps the restore went to the original location and the install to the STORAGE_ROOT location?
Sorry, I was not clear. The duplicity restore did seem to have gone to the /mail-in-a-box folder. If I look at /mailinabox/mail/mailboxes/company.com all my mailboxes are there. But, they are not in the web ui for MIAB?
Haven’t heard of that one. Only one question - you have mailbox stuff (restored) under /mail-in-a-box … does it look like there is ALSO stuff under /home/user-data/mail/mailboxes?
Certainly could. The last part of the duplicity command is the destination name. The command you show will have put the restore into “/mailinabox” which is a completely different folder to “/mail-in-a-box” (which is what you told MIAB to use).
In Linux, every character of the filename is significant - capitals, dots, dashes, everything in the name matters - Mailinabox, MailInABox, mailinabox, mail.in.a.box, and mail-in-a-box are all completely separate folders.
I guess that your system is in a somewhat confused state. Personally, I would wipe that image and start again - rather than having multiple copies of old stuff lying around, etc.
Why did you want to put the mail data in /mail-in-a-box? Unless you’ve got separate volumes, the default location is fine. If you do have a separate volume for mail data, you can mount that volume at the default location (/user/user-data). Just be 100% sure it will always be there after reboot - if it doesn’t mount, that would really confuse MIAB!
ok - so I have given up trying to get the different data folder working. So, I reformatted the Linode and have tried to install again, this time to the defaults…
I have tried this reformat three times and I get stuck at the following…