Re: copying a database in real time.

From: The Natural Philosopher <tnp_at_invalid.invalid>
Date: Wed, 17 Jan 2018 08:53:01 +0000
Message-ID: <p3n2td$6f8$1_at_dont-email.me>


On 16/01/18 21:58, Axel Schwenke wrote:
> On 16.01.2018 19:34, The Natural Philosopher wrote:
>

>> Actually what I did was create a 'tar' of the existing database, sftp it
>> across, stop te mmysql servee and untar it into the mysql databse area.
>>
>> I did lose one record as it overlapped a data update period

>
> You could have done that much more cleverly. I.e. copy the data directory
> with sftp while the server was running. Then wait for a 5 minute window
> without updates, stop the old server, use rsync to synchronize last minute
> changes and finally start the new server. 5 minutes of downtime are a very
> relaxed schedule for that.

Yes, that would have been better.

>
> Another solution with 0 downtime was given to you be Lew in the first answer
> already. Setup the new server as replication slave of the old one. Then you
> can redirect first your readers, then your writers to the new server without
> any interruption of service.
>
Yes, but all of those were so much more work.

-- 
Labour - a bunch of rich people convincing poor people to vote for rich 
people
by telling poor people that "other" rich people are the reason they are 
poor.

Peter Thompson
Received on Wed Jan 17 2018 - 09:53:01 CET

Original text of this message