How to copy file from an old server to reconstitute a database ?

How to copy file from an old server to reconstitute a database ?

am 16.06.2011 19:50:46 von leegold

Hi,

I have a situation where the box with a mysql server will not boot. But
I can boot it from a CD and browse the hard drive and I can mount
partitions so files and data are accessible. I want to somehow take the
Mysql DB structure and content, copy it, and move it to a bootable
working unit. Normally I'd run the script that puts it "all" into a
comma delimited file that can be reconstituted at a later date. But in
my case I can only copy and paste files from an unbootable unit to a
working server and try to reconstitute it from there.

It is Ubuntu 10.4 server. Is what I want to do possible? What
directories and files would I need to copy? First I would have a working
Mysql server on the new unit then I assume I would copy to the new
server and process the data if necessary...any help on how to proceed
appreciated.

Thanks,

Lee G.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: How to copy file from an old server to reconstitute a database ?

am 16.06.2011 20:12:36 von Andrew Moore

--0023547c8c5fbf14f004a5d8365f
Content-Type: text/plain; charset=ISO-8859-1

Lee,

You will need to take the datadir directory, typically found under
/var/lib/mysql/

It would also be a good idea to grab your configuration file from
/etc/mysql/my.cnf or /etc/my.cnf (ubuntu tends to be the former).

Once transplanted into your new server remember to check that the
permissions on the implanted files. Starting the MySQL Server Daemon should
initiate the InnoDB Crash recovery procedure and you should be up and
running again.

That's a 50,000ft overview of the process but unless you're having some
other more serious issues with the data then the previous steps should get
you working again.

A

On Thu, Jun 16, 2011 at 6:50 PM, leegold wrote:

> Hi,
>
> I have a situation where the box with a mysql server will not boot. But
> I can boot it from a CD and browse the hard drive and I can mount
> partitions so files and data are accessible. I want to somehow take the
> Mysql DB structure and content, copy it, and move it to a bootable
> working unit. Normally I'd run the script that puts it "all" into a
> comma delimited file that can be reconstituted at a later date. But in
> my case I can only copy and paste files from an unbootable unit to a
> working server and try to reconstitute it from there.
>
> It is Ubuntu 10.4 server. Is what I want to do possible? What
> directories and files would I need to copy? First I would have a working
> Mysql server on the new unit then I assume I would copy to the new
> server and process the data if necessary...any help on how to proceed
> appreciated.
>
> Thanks,
>
> Lee G.
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=eroomydna@gmail.com
>
>

--0023547c8c5fbf14f004a5d8365f--

Re: How to copy file from an old server to reconstitute a database ?

am 16.06.2011 20:12:51 von Claudio Nanni - TomTom

--90e6ba18182298b40f04a5d837d8
Content-Type: text/plain; charset=ISO-8859-1

Install a same version of MySQL and copy all datadir, watch for privileges
on dir.
On old disk find /etc/my.cnf and find the 'datadir' parameter, that all you
must copy where the new instance has its own datadir.

Claudio
On Jun 16, 2011 7:51 PM, "leegold" wrote:
> Hi,
>
> I have a situation where the box with a mysql server will not boot. But
> I can boot it from a CD and browse the hard drive and I can mount
> partitions so files and data are accessible. I want to somehow take the
> Mysql DB structure and content, copy it, and move it to a bootable
> working unit. Normally I'd run the script that puts it "all" into a
> comma delimited file that can be reconstituted at a later date. But in
> my case I can only copy and paste files from an unbootable unit to a
> working server and try to reconstitute it from there.
>
> It is Ubuntu 10.4 server. Is what I want to do possible? What
> directories and files would I need to copy? First I would have a working
> Mysql server on the new unit then I assume I would copy to the new
> server and process the data if necessary...any help on how to proceed
> appreciated.
>
> Thanks,
>
> Lee G.
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=claudio.nanni@gmail.com
>

--90e6ba18182298b40f04a5d837d8--

Re: How to copy file from an old server to reconstitute a database ?

am 18.06.2011 23:56:20 von leegold

I copied /var/lib/mysql and I am ready to transplant it. But when I
copied, permissions and ownership for files and dirs was not retained.
You said to be careful about permissions, could you elaborate on that a
bit more. On the original hard disk I copied from I did ls -l on some
dirs for example:

$ sudo ls -la /media/fd453d5c-81f5-9c66ff4685bc/lib/mysql
total 20513
drwx------ 5 avahi-autoipd lpadmin 328 2011-06-15 17:03 .
drwxr-xr-x 39 root root 1072 2011-05-17 04:45 ..
-rw-r--r-- 1 root root 0 2011-05-04 18:50
debian-5.1.flag
-rw-rw---- 1 avahi-autoipd lpadmin 10485760 2011-06-15 17:02 ibdata1
-rw-rw---- 1 avahi-autoipd lpadmin 5242880 2011-06-15 17:03
ib_logfile0
-rw-rw---- 1 avahi-autoipd lpadmin 5242880 2011-05-04 18:50
ib_logfile1
drwx------ 2 avahi-autoipd root 2352 2011-05-04 18:51 mysql
-rw-rw---- 1 root root 6 2011-05-04 18:51
mysql_upgrade_info
drwx------ 2 avahi-autoipd lpadmin 1056 2011-05-04 19:06 phpmyadmin
-rw-rw---- 1 avahi-autoipd lpadmin 4 2011-06-15 17:03
videoserver.pid
drwx------ 2 avahi-autoipd lpadmin 528 2011-05-27 22:38 ws_videos

and the DB of interest:

root@ubuntu:/media/fd453d5c-81f5-9c66ff4685bc/lib/mysql/ws_v ideos# ls
-la
total 341
drwx------ 2 avahi-autoipd lpadmin 528 2011-05-27 22:38 .
drwx------ 5 avahi-autoipd lpadmin 328 2011-06-15 17:03 ..
-rw-rw---- 1 avahi-autoipd lpadmin 65 2011-05-04 20:10 db.opt
-rw-rw---- 1 avahi-autoipd lpadmin 8716 2011-05-27 22:38
gallery_photos.frm
-rw-rw---- 1 avahi-autoipd lpadmin 0 2011-05-27 22:38
gallery_photos.MYD
-rw-rw---- 1 avahi-autoipd lpadmin 1024 2011-05-27 22:38
gallery_photos.MYI
-rw-rw---- 1 avahi-autoipd lpadmin 8642 2011-05-27 18:16
login_table.frm
-rw-rw---- 1 avahi-autoipd lpadmin 48 2011-05-27 18:16
login_table.MYD
-rw-rw---- 1 avahi-autoipd lpadmin 2048 2011-05-28 05:24
login_table.MYI
-rw-rw---- 1 avahi-autoipd lpadmin 8622 2011-05-27 22:37
photo_gallery_category.frm
-rw-rw---- 1 avahi-autoipd lpadmin 0 2011-05-27 22:37
photo_gallery_category.MYD
-rw-rw---- 1 avahi-autoipd lpadmin 1024 2011-05-27 22:37
photo_gallery_category.MYI
-rw-rw---- 1 avahi-autoipd lpadmin 8864 2011-05-23 16:27 vid_table.frm
-rw-rw---- 1 avahi-autoipd lpadmin 254504 2011-06-12 01:32 vid_table.MYD
-rw-rw---- 1 avahi-autoipd lpadmin 18432 2011-06-12 04:20 vid_table.MYI

all this permission info is lost in the copied...

What has to be recreated per ownership and permissions and how deep into
these directories do I have to drill down to and fix regarding this?

Aside from permissions I assume I take datadir and directly transplant
it and check that the /etc config files are OK?

Help appreciated.

Lee G.


On Thu, 16 Jun 2011 19:12 +0100, "Andrew Moore"
wrote:
> Lee,
>
> You will need to take the datadir directory, typically found under
> /var/lib/mysql/
>
> It would also be a good idea to grab your configuration file from
> /etc/mysql/my.cnf or /etc/my.cnf (ubuntu tends to be the former).
>
> Once transplanted into your new server remember to check that the
> permissions on the implanted files. Starting the MySQL Server Daemon
> should
> initiate the InnoDB Crash recovery procedure and you should be up and
> running again.
>
> That's a 50,000ft overview of the process but unless you're having some
> other more serious issues with the data then the previous steps should
> get
> you working again.
>
> A
>
> On Thu, Jun 16, 2011 at 6:50 PM, leegold wrote:
>
> > Hi,
> >
> > I have a situation where the box with a mysql server will not boot. But
> > I can boot it from a CD and browse the hard drive and I can mount
> > partitions so files and data are accessible. I want to somehow take the
> > Mysql DB structure and content, copy it, and move it to a bootable
> > working unit. Normally I'd run the script that puts it "all" into a
> > comma delimited file that can be reconstituted at a later date. But in
> > my case I can only copy and paste files from an unbootable unit to a
> > working server and try to reconstitute it from there.
> >
> > It is Ubuntu 10.4 server. Is what I want to do possible? What
> > directories and files would I need to copy? First I would have a working
> > Mysql server on the new unit then I assume I would copy to the new
> > server and process the data if necessary...any help on how to proceed
> > appreciated.
> >
> > Thanks,
> >
> > Lee G.
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe: http://lists.mysql.com/mysql?unsub=eroomydna@gmail.com
> >
> >
>

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: How to copy file from an old server to reconstitute a database ?

am 19.06.2011 00:13:24 von Claudio Nanni - TomTom

--90e6ba6e84c48f885204a603cfb9
Content-Type: text/plain; charset=ISO-8859-1

Lee,

do this:

sudo chown -R mysql:mysql /media/fd453d5c-81f5-9c66ff4685bc/lib/mysql

in your /etc/my.cnf check that:

datadir=/media/fd453d5c-81f5-9c66ff4685bc/lib/mysql

and you should be able to start it

also set the mysql error log to a known position:
log-error=/var/log/mysql_123.log (or whatever)

post the tail -100 of this error log in case of problems

Cheers

Claudio

2011/6/18 leegold

>
> I copied /var/lib/mysql and I am ready to transplant it. But when I
> copied, permissions and ownership for files and dirs was not retained.
> You said to be careful about permissions, could you elaborate on that a
> bit more. On the original hard disk I copied from I did ls -l on some
> dirs for example:
>
> $ sudo ls -la /media/fd453d5c-81f5-9c66ff4685bc/lib/mysql
> total 20513
> drwx------ 5 avahi-autoipd lpadmin 328 2011-06-15 17:03 .
> drwxr-xr-x 39 root root 1072 2011-05-17 04:45 ..
> -rw-r--r-- 1 root root 0 2011-05-04 18:50
> debian-5.1.flag
> -rw-rw---- 1 avahi-autoipd lpadmin 10485760 2011-06-15 17:02 ibdata1
> -rw-rw---- 1 avahi-autoipd lpadmin 5242880 2011-06-15 17:03
> ib_logfile0
> -rw-rw---- 1 avahi-autoipd lpadmin 5242880 2011-05-04 18:50
> ib_logfile1
> drwx------ 2 avahi-autoipd root 2352 2011-05-04 18:51 mysql
> -rw-rw---- 1 root root 6 2011-05-04 18:51
> mysql_upgrade_info
> drwx------ 2 avahi-autoipd lpadmin 1056 2011-05-04 19:06 phpmyadmin
> -rw-rw---- 1 avahi-autoipd lpadmin 4 2011-06-15 17:03
> videoserver.pid
> drwx------ 2 avahi-autoipd lpadmin 528 2011-05-27 22:38 ws_videos
>
> and the DB of interest:
>
> root@ubuntu:/media/fd453d5c-81f5-9c66ff4685bc/lib/mysql/ws_v ideos# ls
> -la
> total 341
> drwx------ 2 avahi-autoipd lpadmin 528 2011-05-27 22:38 .
> drwx------ 5 avahi-autoipd lpadmin 328 2011-06-15 17:03 ..
> -rw-rw---- 1 avahi-autoipd lpadmin 65 2011-05-04 20:10 db.opt
> -rw-rw---- 1 avahi-autoipd lpadmin 8716 2011-05-27 22:38
> gallery_photos.frm
> -rw-rw---- 1 avahi-autoipd lpadmin 0 2011-05-27 22:38
> gallery_photos.MYD
> -rw-rw---- 1 avahi-autoipd lpadmin 1024 2011-05-27 22:38
> gallery_photos.MYI
> -rw-rw---- 1 avahi-autoipd lpadmin 8642 2011-05-27 18:16
> login_table.frm
> -rw-rw---- 1 avahi-autoipd lpadmin 48 2011-05-27 18:16
> login_table.MYD
> -rw-rw---- 1 avahi-autoipd lpadmin 2048 2011-05-28 05:24
> login_table.MYI
> -rw-rw---- 1 avahi-autoipd lpadmin 8622 2011-05-27 22:37
> photo_gallery_category.frm
> -rw-rw---- 1 avahi-autoipd lpadmin 0 2011-05-27 22:37
> photo_gallery_category.MYD
> -rw-rw---- 1 avahi-autoipd lpadmin 1024 2011-05-27 22:37
> photo_gallery_category.MYI
> -rw-rw---- 1 avahi-autoipd lpadmin 8864 2011-05-23 16:27 vid_table.frm
> -rw-rw---- 1 avahi-autoipd lpadmin 254504 2011-06-12 01:32 vid_table.MYD
> -rw-rw---- 1 avahi-autoipd lpadmin 18432 2011-06-12 04:20 vid_table.MYI
>
> all this permission info is lost in the copied...
>
> What has to be recreated per ownership and permissions and how deep into
> these directories do I have to drill down to and fix regarding this?
>
> Aside from permissions I assume I take datadir and directly transplant
> it and check that the /etc config files are OK?
>
> Help appreciated.
>
> Lee G.
>
>
> On Thu, 16 Jun 2011 19:12 +0100, "Andrew Moore"
> wrote:
> > Lee,
> >
> > You will need to take the datadir directory, typically found under
> > /var/lib/mysql/
> >
> > It would also be a good idea to grab your configuration file from
> > /etc/mysql/my.cnf or /etc/my.cnf (ubuntu tends to be the former).
> >
> > Once transplanted into your new server remember to check that the
> > permissions on the implanted files. Starting the MySQL Server Daemon
> > should
> > initiate the InnoDB Crash recovery procedure and you should be up and
> > running again.
> >
> > That's a 50,000ft overview of the process but unless you're having some
> > other more serious issues with the data then the previous steps should
> > get
> > you working again.
> >
> > A
> >
> > On Thu, Jun 16, 2011 at 6:50 PM, leegold wrote:
> >
> > > Hi,
> > >
> > > I have a situation where the box with a mysql server will not boot. But
> > > I can boot it from a CD and browse the hard drive and I can mount
> > > partitions so files and data are accessible. I want to somehow take the
> > > Mysql DB structure and content, copy it, and move it to a bootable
> > > working unit. Normally I'd run the script that puts it "all" into a
> > > comma delimited file that can be reconstituted at a later date. But in
> > > my case I can only copy and paste files from an unbootable unit to a
> > > working server and try to reconstitute it from there.
> > >
> > > It is Ubuntu 10.4 server. Is what I want to do possible? What
> > > directories and files would I need to copy? First I would have a
> working
> > > Mysql server on the new unit then I assume I would copy to the new
> > > server and process the data if necessary...any help on how to proceed
> > > appreciated.
> > >
> > > Thanks,
> > >
> > > Lee G.
> > >
> > > --
> > > MySQL General Mailing List
> > > For list archives: http://lists.mysql.com/mysql
> > > To unsubscribe:
> http://lists.mysql.com/mysql?unsub=eroomydna@gmail.com
> > >
> > >
> >
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=claudio.nanni@gmail.com
>
>


--
Claudio

--90e6ba6e84c48f885204a603cfb9--