For some reasons, I'm changing my hosting service for my web application. The problem, is that I need to keep my site accessible and fully working during the process.
I want to be sure that my plan to achieve this gonna work, so let talk about the infrastructure.
DNS Records:
A record : torquemanagement.ca -> 138.197.83.23
A record : dev.torquemanagement.ca -> 138.197.83.23
CNAME record : dev -> @
Host on CompanyA:
IP: 138.197.83.23
PHP Laravel application deployed with git/branch master
Mysql Connetion into .env pointing to Something
Mysql Database having name: Something
Host on CompanyB:
IP: 159.89.124.24
PHP Laravel application deployed with git/branch master
Mysql Connetion into .env pointing to SomethingElse
Mysql Database having name: SomethingElse
Before talking about the procedure I plan to use, is there a conflict in my CNAME and A record about the sub domain. Should I just use the A or the CNAME???
How I plan to achieve this without interruption of services.
1. Export SQL dump from Something(companyA) and import it into SomethingElse(companyB).
2. Changing the Mysql Connection from .env file onto host CompanyA to the Mysql DB onto host CompanyB
3. Export SQL to only updates new record from Something and import it into SomethingElse.
3.A. I think this will prevent lost of any record save to DB of companyA while doing the export/import.
4. Changing ALL ip in DNS records to point 159.89.124.24 (ip of host CompanyB)
5. Waiting 48hrs or more.
6. Shutting down host on CompanyA
If I'm doing this, will my services stay available? From my understanding, while the process of changing the DNS over the net, people connecting to CompanyA will get result from the new Database onto host of CompanyB and when the process will be finish, they will not lost any record.
What do you think?
Am I wrong?
Is there any alternative to keep services alive?