I have all the passwords for the email accounts
this will facilitate the migration
Is it possible to copy the mail boxes over from the DA server to the CP server with scp or the such like
I don't know the DA server, so I can't comment on this possibility.
On the other hand, what is certain is that the DA server must have the IMAP service, just like CPANEL.
So using imapsync will work anyway.
In addition, you will probably not be able to switch the mail flow at once to the new server (due to the DNS cache and the DNS propagation time of the changes), so you will probably have to redo the transfer of some new mails still comming in to the old server several times.
Once you have created the imapsync configuration file you can run it as often as needed without much effort.
I have never used imapsynch
There is a good howto on
imapsync/imapsync
It looks impressive, but you only need a few options. The quantity or the age of the mails is not a problem, it will take time that's all.
Look at the part "HUGE MIGRATION" and create your text file "file.txt" as showed,
Code:
user001_1;password001_1;user001_2;password001_2
user002_1;password002_1;user002_2;password002_2
user003_1;password003_1;user003_2;password003_2
user004_1;password004_1;user004_2;password004_2
and create a second file for the shell script, say "migrate_mail.sh"
of course replace OLDSERVER.COM with the hostname or IP of your old server, and likewise with NEWSERVER.COM
Bash:
#!/bin/sh
{ while IFS=';' read u1 p1 u2 p2; do
imapsync --host1 OLDSERVER.COM --user1 "$u1" --password1 "$p1" \
--host2 NEWSERVER.COM --user2 "$u2" --password2 "$p2"
done ; } < file.txt
Give it executable rights.
and execute
First use the "--dry" option, so nothing happens in real and you can see of all is fine, and first try with only one test mailbox.
Look at an example here
https://imapsync.lamiral.info/examples/imapsync_example.sh
At present the DNS is at the DA server and at Namecheap the DNS is set to ns1.SERVERA.co.uk and ns2 respectively
So if I change the DNS back to name cheap as a first thing
Yes, since you are going to quit the DA server, you have to move the DNS first.
If Namecheap allows DNS to be configured there, why not.
You could also configure DNS on the new CPANEL server and make the NS records at namecheap point to the new CPANEL server.
Think about it that a DNS change needs a few days to propagate.
And each correction of any error takes the same time to propagate too
first thing to do and set the web and mail up on there
No, only DNS goes to namecheap (or other) or to the new CPANEL server first.
keep at the start mail and web on the old server.
Only once DNS is stable on his new place move the web to his new cloud-server,
and change then the A record of the domain to the new IP of that cloud-server.
For the mail
First create the mailboxes on the new CPANEL server (with the same usernames / passwords you have)
and
only after that change the MX record to the new IP of the new CPANEL server (or you will lose new incomming mail....)
You can run imapsync after that if you use the IP of the old and new server so you do not have to wait the DNS-propagation.
www & ftp - anything else ?
It will be necessary to copy what there is now.
Usually the A record is for the main domain, and CNAME can be used for all hostnames that point to the same IP.
But as you now will have different IPs for the web and the mail, you will have to point the domain and the www alias to the webserver IP,
and create A records for the hostnames that your users uses in theire email-client to point to the new CPANEL server.
The server a has a subdomain that is mainly used so presume subdomain as an A record as well ?
I don't quite understand, so it's a little dangerous to say something. Let's say if the subdomain points to different content than the main domain, then yes, an A record might make sense.
If it's just a service (like POP, IMAP, SFTP, etc.) a CNAME is fine, but the difference is not that big.
On the other hand, take care to copy and update the hostnames that your users have configured in their email client
Before starting, make a todo-list with the order of what you are going to do, and the wait times for DNS propagations.
And above all:
make sure you have a backup of everything before you start ... you never know.
Email migration is the trickiest because it's a continuous flow, and users are easily irritable when it doesn't work.
So once the boxes have been created on the new CPANEL server, I would do the MX modification and the hostname modifications (A records and CNAME records) that the users use in the email-client on a Friday evening, then run the mail transfer script via imapsync.
If all goes well, users will find their email on Monday morning.