Skip to main content

Website & Email on a different server

Comments

6 comments

  • kodeslogic
    Once you migrate your website data to IPB cloudhosting server B and emails to cPanel account Server C then you'll have to - point the A record for the domain to IPB cloudhosting server B so that the website resolve from there. - point the MX record for the domain to cPanel account Server C in order to route your email from the Server C This needs to be done on your DNS server.
    0
  • Markif
    Looks like a work for DNS and some planning / todo-list. As I understand you will quit the DA server, you should first put the DNS at your domain-name provider so its independent of your web / email servers. Remember DNS changes takes some days to propagate through the internet. Once DNS stable at your domain-name-provider (or other DNS provider), make the cache-time of the DNS records smaller (so other DNS servers will ask for the new setting faster). The website goes to the cloud, OK, it will have a new IP -address. That has to be put in the A-record of the DNS of your domain-name. The www. prefix is often solved with a CNAME record (www CNAME mydomain.com) Then the email. I suppose you want them on CPANEL (we are on a CPANEL forum :-) ) If you have only one domain they have "solo" license. If your mail is already on a CPANEL server you can use there "Transfer or Restore a cPanel Account" If the source is not on a CPANEL server you can use tools like imapsync. The howto is different if you know or not the passwords of the mailboxes, or if you need to apply new passwords. Once the mail transfer is over to the new server, change the MX-records of the DNS to point to the IP of that new server. As this DNS-change will take some time to propagate, you will have to run different times tools like imapsync until you see there is no mail entering into the old server anymore (it should go to the new IP you have put in the MX record). This is typically something to start on a Friday night, and repeat during WE, so users have all OK when they come again in office on monday. If you can set back their passwords they will see no difference. If you don't know their password you can always try to copy their entry in the /home//etc//shadow file (on CPANEL) Or you will have some communication of new passwords and howto change the password in their mail-client. Best prepare users before, so they don't panic on Monday that their mail does not work ! If you have a small number of boxes you can offer some remote config via things as TeamViewer to make your users happy. Also change on time in the DNS the hostnames that your users use to access the mail services : mail.mydomain.com ? or smtp.mydomain.com, imap.mydomain.com, etc... Best to test first with one test mailbox... CPANEL can very good work with only mail on it, and web elsewhere : il just how to what the DNS entries point to.
    0
  • Cloud9
    Thanks @Markif The new server for mail will be a cPanel server - not that keen on DA to be honest - its a bit "clunky" There is only 1 domain on the DA server - dedicated server - for 1 website (although it runs on a subdomain) I have all the passwords for the email accounts and also have root access to the DA server Is it possible to copy the mail boxes over from the DA server to the CP server with scp or the such like I have never used imapsynch and there are quite a lot of emails going way back to 2012/14 ish 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 to do and set the web and mail up on there
    0
  • Cloud9
    With the A record in host I presume I need a few of these, like www & ftp - anything else ? MX record for host presume I need mail The server a has a subdomain that is mainly used so presume subdomain as an A record as well ? And do I need a CName in any thing ?
    0
  • Markif
    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, 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 [CODE=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. [CODE=bash]chmod migrate_mail.sh +x
    and execute [CODE=bash]# ./migrate_mail.sh
    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
    0
  • cPRex Jurassic Moderator
    Thanks for the great replies!
    0

Please sign in to leave a comment.