After a little bit of futzing around, I think I’ve figured out a good way to transfer email accounts in bulk from a cPanel shared hosting account to a mail-in-a-box server. See this Gist:
Please note that this is a work-in-progress, drawn from my own digging and experimenting. Let me know if you see anything that is incorrect, missing, or needing clarification. I take no responsibility for any lost data!
Yup. If you have a lot of domains, I’d start by doing one just to make sure it is working as expected. After that, you could probably just modify the script so it loops through the rest of your domains.
I think @jamiele23 is just asking how to run PHP from the CLI in general, not on the MiaB server specifically. My script is a one-time script that can be run on any machine - it doesn’t need to be run on the mail server.
As long as you have PHP installed on your machine, you can simply run it by doing
root@box:~# sqlite /home/user-data/mail/users.sqlite
Unable to open database “/home/user-data/mail/users.sqlite”: file is encrypted or is not a database
Really like this idea. Personally, I’d prefer a script like imapsync, because it’s more versatile - but for some complete overkill and more difficult to setup due non standard dependencies.