A
A
Andrey Ivchenkov2016-09-19 16:10:30
MySQL
Andrey Ivchenkov, 2016-09-19 16:10:30

What is the best and fastest way to migrate a database to a new server?

There is a site with a large database (about 30Gb) and high attendance. It is required to transfer it to another server, and the downtime of the site must be minimized.
The first thought that came to mind is to use mysqldump. But with it, it turns out that the site must be put into maintenance mode from the moment the dump is created until the dump is completely restored on another server. Those. make a dump, transfer it to another server and restore. Moreover, restoring a dump takes much longer than creating it (although I used the --opt key when creating it). You can still use the percona innoxtrabackup tool, but the target server has a different version of mysql (5.7, and 5.5 on the source).
Who will advise what?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Yarkov, 2016-09-19
@Groonya

And to include replication on other server?
https://habrahabr.ru/post/56702/

D
Dimonchik, 2016-09-19
@dimonchik2013

in general, replication should be initially
the version of the database - only
transfer the same ones, then update
it, incl. and replication requirements
b_uky2uxiaamizi.jpg

X
xmoonlight, 2016-09-20
@xmoonlight

Do not drink the brain neither to us nor to anyone!
1. Test the speed of the channel or the courier-admin from the HDD and the method in the lab.
2. Post a public announcement that the base will move in 3-4 days and the service will be unavailable, because You transfer the entire 30GB database and set the service to READ-ONLY mode during this interval! (this must be written so that people do not have the feeling that your service is malfunctioning!) . Write the approximate date of resumption of work: date-time.
3. Get ready for it!
4. Set READ-ONLY for the base (+declare at the top in the GUI) or a stub (if RO cannot be done due to the BP), that work is underway to transfer the base. In general, you need to have a clear separation: 1. the structure of the base (this goes without saying)
And calmly do a FULL DUMP and then RESTORE IT on a new server.
2. tables and data of the system / application (publications, accesses, admin panel, CMS, logs, etc., i.e. everything that is corrected by the owners of the service or the system)
3. tables and user data (accounts, comments, etc.)
Only then will you be able to clearly control requests and transfer data for users in a "transparent" mode without stopping the service.
Because to transfer the data of one user - you need much less time.
Yes, and pay attention to the hippo from dimonchik2013 ! => This is the main thing!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question