[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: migrating my lenny install from 32-bit to 64-bit?



On Wed, 16 Sep 2009, Andrew Sackville-West wrote:

> On Wed, Sep 16, 2009 at 10:14:40AM -0400, Robert P. J. Day wrote:
> > On Wed, 16 Sep 2009, Sven Joachim wrote:
> >
> > > On 2009-09-16 15:49 +0200, Robert P. J. Day wrote:
> > >
> > > >   a question about mysql.  i want to reproduce all the mysql
> > > > databases on the new system.  is it sufficient to copy all of
> > > > /var/lib/mysql? is that where the databases are physically
> > > > stored? as opposed to doing mysql dumps and restores?
> > >
> > > I'm no database exports, but copying the files is only safe to
> > > do when the SQL server is not running.  Dumps and restores are
> > > the officially recommended way, AFAIK.
> >
> >   i have the freedom to shut down the mysql server after hours.
> > so would that be the *only* issue?  as in, once the server isn't
> > running, is doing a straight copy of /var/lib/mysql a perfectly
> > safe and valid thing to do?  and i'm assuming i'd want to
> > reproduce any configuration changes under /etc/mysql as well.  so
> > that would work just fine, would it?  excellent.
>
> I can't answer the question about copying /var/lib/mysql, though,
> since the destination isn't live, you could certainly try it. If it
> fails, you are only out some copying time.
>
> But one thing you might consider with the db migration, is to move
> *only* the db after hours and have your services on the old machine
> connect to the db on the new machine. Then you can verify that it is
> all working and even run your services live on that db on the 64 bit
> machine while you continue the migration.

  nice idea, but i don't have that option as there will be a physical
switchover where the current server is taken offline at the same
moment the new one comes on at the same IP address.  well, i guess i
*could* do it that way but it seems easier to just wait for a quiet
time, turn off the current mysql server, then copy the DBs shortly
before the switch.

  which brings me back to my original question -- even though i know
doing official mysql backups and restores are the *official* way to
migrate the databases, as long as i can stop mysql on the current
server, can i just then copy the entire /var/lib/mysql directory over
to the new system to move the databases?  or more specifically, just
those /var/lib/mysql subdirectories corresponding to the databases i
want to move?  is that *technically* a valid thing to do?  (even if it
makes some people wince.  :-)

rday

p.s.  curiously, on the new system waiting for all that migrating
data, /var/lib/mysql has three entries that don't exist on the current
system:

ibdata1  ib_logfile0  ib_logfile1

not sure what those are, but they're sizable.  maybe i *will* do the
dump/restore thing, just to play it safe after all.
--

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

        Linux Consulting, Training and Annoying Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================


Reply to: