As PIC of Excellent Zimbra VPS service. Last month, I got a new client who want to migrating their email server to Excellent Zimbra VPS. Previously, they use cpanel for the email server.
I have assign from my boss to setup their VPS from zero. Starting from installation until switching to the new server.
When i want to Export and Import their users, i following my senior guidance “Ahmad Imanudin“. From here : https://imanudin.com/2014/12/27/tips-exportimport-accountpassword-cpanel-to-zimbra/. However, it only import their usernames without the passwords. Because it use “/etc/DOMAIN/@pwcache/” to import and export their user email WHILE the complete users and password located at “/etc/DOMAIN/shadow“. You can see them at cPanel File Manager.
So, what i can do now ??
First, I’ve created the simple bash script again, this bash script referrals from My Senior Ahmad Imanudin, if he read my article, i wanna say “Thank you Om :-D”.
But to accomplish the script, i need the “shadow” file from cPanel, you can Login Into cPanel | File Manager. Go to the shadow directory (/etc/DOMAIN/) and download it.
Now, Connect and login into your Zimbra Servers via SSH and download with following guidance.
cd /srv wget -c https://dhenandi.com/repo/export-import-acc-cpanel.zip unzip export-import-acc-cpanel.zip cd ex-im/
Copy your downloaded shadow file from your computer into your script directory with WinSCP or SCP (/srv/ex-im). If it’s already, In the there folder should be three files :
Than, Execute the script file “script-export-acc-cpanel.sh” with root permissions.
cd /srv/ex-im chmod +x script-export-acc-cpanel.sh ./script-export-acc-cpanel.sh
If it has finished, it will be generate (.zmp) file. The file is “create–account–zimbra.zmp“. Finally, you just to execute the ZMP script to Import the cPanel user with the following guidance :
su - zimbra zmprov < /srv/ex-im/create-account-zimbra.zmp
and then, the user will be created at few seconds.
Okay, For further information, don’t hestitate to contact me on article comments. Thank you 😉
If you Indonesian people, you can watch this video :