M
M
My joy2019-10-24 14:57:08
Data transfer
My joy, 2019-10-24 14:57:08

How to transfer production to another server while maintaining the domain?

Hi friends!

There is a need to move from a weak vps to a dedicated one. vps is no longer up to the task.

(The system is currently using nginx/mysql/php-fpm)

The problem is that the system is constantly used, and I don't know how exactly to transfer everything without downtime, while maintaining the same domain. As far as I understand it is necessary:

  1. Set up a new server
  2. Set up mysql replication on the old server to the new server
  3. Change in the config of the old server to use the connection to the new server
  4. Make from master's replica
  5. Change the A-record in the domain (put a new IP there)


And as I understand it, while DNS is being updated, the server may be unstable.

Please tell me how to check this. Surely the task is trivial, and I'm not the first who transfers a working production to a new machine, but nothing sensible is googled.

Share your experience! Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sanes, 2019-10-24
@Sanes

  1. We extinguish the old server so that there are no collisions
    This way you minimize downtime. For some, it won't even be noticeable. You can first reduce the TTL to a minimum on A-records.

V
Vitaly Karasik, 2019-10-24
@vitaly_il1

If the webserver and the database were and will live together, then:

  1. In DNS, reduce the TTL for your zone to 5 minutes
  2. Set up a new server that will look at the new base
  3. Set up mysql replication on the old server to the new server
  4. On your laptop, use the hosts file to point www.example.com to the new address and make sure it works.
  5. Change DNS and follow the update - https://www.whatsmydns.net/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question