Backing up MySQL without the dumping
I now have over 20 databases on my server and backing them up by manually dumping them into a file is becoming a chore so I was wondering if I am right in thinking that if I take a backup of /var/lib/mysql I will be backing up every database on the server.
Any feedback would be great. Thanks all. |
Hi,
I think you're right in what you suggest. I have, in the past, just taken copies of the database subdirectories in /var/lib/mysql... restoring was as easy as just copying the directories + contents back again... |
Exellent.
Just wanted to check before I relied on it! Many thanks. Jamie |
Hi, I am in a situation where I need to manually backup my databases.
I am going to Code:
sudo tar -zcvpf ./MySQL`date '+%Y%m%d'`.tar.gz /var/lib/mysql/ I was thinking this. I have a WordPress database and a Gallery database. 1.install Wordpress/Gallery 2. In Mysql assign the database that Wordpress/Gallery IS going to use the same name as I have backed-up in the /var/lib/mysql/ 3.extract the tar file in the /var/lib/mysql/ is there any other steps? I don't know if i remember the user's and passwords to use the databases through the programs. Is that a problem? thank you. |
Jerry -
Not an answer to your questions - just a comment: Using mysql dumps for backups has drawbacks and for a sysadmin who wants to be able to recover from a hardware failure then backing up the whole directory might be the way to go. But for backing up a personal blog I'd argue that a mysql dump is a safer backup strategy. It's light (a few megs at most - can be emailed from scripts, placed on USB sticks...) but moreover it's portable - perfect for the day you want to switch ISP, OS, upgrade mysql versions etc. Also, no need to worry about remembering passwords, aligning users on new system, etc. I do this on a regular basis for my Wordpress install (and moved my blog around in more than one occasion): Code:
#!/bin/sh |
yea, see I was stupid before I did an upgrade, and i didn't back up. I did a force upgrade using apt-get, jumping from 5.04 to 6.04 and i got some socks error in my mysql and read up on it big time but none of the solutions worked.
plus I had no internet because it also broke my network card, lots of factors, and i need to complete a task at hand, before tuesday. But Thank you for the response. Definitely in the future i will be more generous with my backups. if anyone else knows about manual backups i would love to hear about it :-P Night |
I believe that Gallery2 the photo gallery that i am using keeps all its pictures in a user so i also am backing up that user.
I don't know if it works, i have all the pictures backup, but i don't know if the database will convert over correctly. So if all fails i will have to do everything manually |
OK I am having trouble now. I am leaving Gallery for now. I am working on putting my WordPress blog back into my new system.
this is what I have done. Quote:
Code:
It doesn't look like you've installed WP yet. Try running install.php. any thoughts? |
alright couldn't fix it. Reinstalled.
|
All times are GMT -5. The time now is 11:14 PM. |