Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi All,
Our development group set up a Linux box about ten years ago to first serve as a print server and snad box for us to play with linux. Over time we have relied more on this system and use it as a web server, samba server, PDF generator and a bug tracker.
Well after a power outage the machine will no longer boot. We've tried everything we can think of and have decided it was time for a new machine anyway. I have switched to Ubuntu and have restored all functionality with the exception of our bug tracking db. It is a LAMP based system called MANTIS. I have the source files for Mantis. What I do not have is the Mysql database that it was tied to. I can access the hardrive that the database resided on via an Ubuntu live cd. Is there anyway to get to that data, back it up, and restore it on the new system?
If you can get to the old /var/spool/mysql directory, grab everything from there, and put it in the same location on your new system. Pray that it's readable, and not corrupted.
If you don't find that directory, check your mysql config on the old box, to tell you where the directory was, and put it back on the new server in the same place. If you have a mysql dump of the old database, that's even better, and can be restored very quick.
TB0ne,
Thanks. That worked perfectly. I didn't realize it would be that simple.
Chris
You're very welcome. And it's a crap shoot if that works or not. One little file inconsistency, and the database won't come back up.
FWIW, I'd either go through mysql-administrator (GUI utility, very nice if you've never used it), and schedule daily database backups, to some other system. You can also use mysql-dump, and CRON that, to grab a good snapshot of your database(s). Even if you put the backup files on the same system, you can always copy them off to your workstation, or move them somewhere else, just in case. The copy-trick doesn't always work.
I only copied the single database folder that I needed.
I did setup a cron job to run mysqldump on all of our key databases. This used to get done regularly but for some reason around January the back ups were stopped.
The cron jobs dump the backups out to our network.
Distribution: Debian Bookworm, Raspbian. Also Mint, SliTaz, Sparky, Xubuntu.
Posts: 28
Rep:
cmfarley, I hope you might still find this OLD thread. You said
Quote:
I only copied the single database folder that I needed.
If I understand right, that's what I tried, but it isn't working.
I had a MySQL database called MyReferences to keep track of articles and books that I've read. I don't know how, but it's gone. I never made a real MySQL backup (with mysqldump or such), but I do have backups of all the files in the computer.
This is a Debian system, and the files that contain MySQL databases are in /var/lib/mysql/. There is no /var/spool/mysql as TB0ne referred to. I suppose they serve the same purpose.
On my backup system there is a copy of /var/lib/mysql/MyReferences/. I copied that directory into /var/lib/mysql/ on my active system. But after that, when I start MySQL and issue "show databases", MyReferences is not listed.
cmfarley, I hope you might still find this OLD thread. You said
If I understand right, that's what I tried, but it isn't working.
I had a MySQL database called MyReferences to keep track of articles and books that I've read. I don't know how, but it's gone. I never made a real MySQL backup (with mysqldump or such), but I do have backups of all the files in the computer.
This is a Debian system, and the files that contain MySQL databases are in /var/lib/mysql/. There is no /var/spool/mysql as TB0ne referred to. I suppose they serve the same purpose.
On my backup system there is a copy of /var/lib/mysql/MyReferences/. I copied that directory into /var/lib/mysql/ on my active system. But after that, when I start MySQL and issue "show databases", MyReferences is not listed.
Any thoughts?? Thanks much.
Will
Please open your own thread for your own question.
The directory can be specified in the MySQL config file, so /var/lib/mysql can probably be the same thing as the /var/spool/mysql, or anywhere else you set up MySQL to work. Check /etc/my.cnf, and look for the "datadir" directive...that's the directory you need to copy.
Again, see my previous post...this MAY or MAY NOT work...to be as close to 100% as you can, use a dump/backup tool.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.