Combining two different instances of MiaB

Hello. I have to first say that MiaB is a great project! My thanks and kudos to Josh and everyone working on the project. I wish that I had the skills to contribute in some way.

At present we are running two instances of Mail-in-a-Box. They are for different sets of clients. We wish to combine the two into one – on one server rather than two.

This begs the question of the best course of action to take to accomplish this. I would really prefer not to have to add the two dozen email boxes and aliases manually through the admin panel. But I do not have the first clue how to integrate the two within the database. I will assume that I can simply copy the email directories from one to the other though.

Any guidance? Thanks!

On the second question, of copying the email directories over, yes, that’s exactly what you’d do.

For the first question, this is mainly a matter of getting the information in both sqlite databases into one. You can find the database in this location, and the second command puts you inside the SQL prompt.

cd /home/user-data/mail
sudo sqlite3 users.sqlite

You also need to re-create any Custom DNS records. You find these as so:

cd /home/user-data/dns
nano custom.yaml

If you merge both of those sets of information, you can then run the mailinabox command again (the command you originally ran to setup) and it should configure the merged box correctly. If you don’t bring the TLS certs over, you’d need to provision those again.

Hopefully that helps you some.

Thanks for the reply.

I am good to go on the DNS issues. We actually will use external DNS and all is good there. That part will be simple.

It is the issue of “merging” the two sqlite databases that I would be completely clueless on. What would I need to do once I am ‘inside the SQL prompt’?

See my comments there. If you don’t care about the passwords you should be able to reactivated the accounts if you copy the directories in. (Please test this though)

Owncloud will be harder. (See github issue)