|
Moving mail accounts in H-Sphere is not fully automated, which means it can be
applied to individual accounts or small groups of accounts. The below procedure
doesn't work well with large groups of mail accounts or entire resellers.
Please be prepared that due to the propagation of the new IP address, mail
account move can result in up to 24 hour downtime and inability to edit the mail boxes.
To move a group of user accounts from one mail server to another:
- On the new mail server, log in as root and run the following commands for each domian:
~vpopmail/bin/vadddomain [domainname] [anypass]
rm -rf domains/[domainname]
scp -r root@[oldserverIP]:~vpopmail/domains/
~vpopmail/domains/[domainname]
chown -R vpopmail:vchkpw ~vpopmail/domains/[domainname]
where:
[domainname] is the mail domain
[anypass] is any string. Later it will be replaced with the real password
[oldserverIP] is the IP address of the source mail server.
Then Restart mail server.
- On the old mail server, log in as root and delete the domains using this command for each domain:
~vpopmail/bin/vdeldomain [domainname]
- Log into the CP server as the cpanel user and update H-Sphere system database
using the following command for each affected account:
su -l cpanel
java psoft.hsphere.tools.ChangeLServerId -a [account_id] -f [old_id] -t [new_id]
where:
[account_id] - the id of the affected H-Sphere account
[old_id] - the id of the source logical server
[new_id] - the id of the target logical server
- IMPORTANT!!! Back up H-Sphere system database.
- Get current values from the MX records for the moved accounts:
select r.id, r.name, r.type, r.data, r.ttl, r.pref from domains d, parent_child p1, parent_child p2, dns_records r where d.name='DOMAIN_NAME' and d.id = p1.parent_id and p1.child_type=1000 and p1.child_id = p2.parent_id and p2.child_type=1007 and p2.child_id = r.id;
where DOMAIN_NAME is the domain name you are checking MX for.
- Update the MX records with the new values:
update dns_records SET data='TARGET_MAIL_SERVER_NAME' where id = 'ID_YOU_GOT_ON_THE_PREVIOUS_STEP';
- As the cpanel user, update your DNS settings using the DNS Creator utility:
java psoft.hsphere.tools.DNSCreator -m db -dz -z DOMAIN_NAME
where DOMAIN_NAME is the domain name you are updating MX for.
|