Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Jul 22, 2015 10:23 am 
Offline
Senior Member

Joined: Fri Feb 11, 2011 1:36 pm
Posts: 118
obs, is it possible to restore the database using the files under "/var/lib/mysql" ?


Top
   
PostPosted: Wed Jul 22, 2015 11:06 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Possibly it depends how corrupt things are and what format the tables were in. InnoDB is a lot easier than MyISAM. Either way it's not something I can instruct over a forum.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
PostPosted: Wed Jul 22, 2015 11:22 am 
Offline
Senior Member

Joined: Fri Feb 11, 2011 1:36 pm
Posts: 118
Just wondering, maybe it´s a good idea to sign up for another linode, fresh WAMP setup and try to move all my site´s files and recover the database, what do you think?
My Ubuntu version is 12.04, do you think it is worth to install Ubuntu 14, would that make the migration harder?


Top
   
PostPosted: Wed Jul 22, 2015 2:02 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
How do you plan on recovering the database? Just copying /var/lib/mysql to a new node won't help and upgrading to 14.04 will make things more complicated

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
PostPosted: Thu Jul 23, 2015 10:04 am 
Offline
Senior Member

Joined: Fri Feb 11, 2011 1:36 pm
Posts: 118
I was planning to do something like in this tutorial:
http://www.thegeekstuff.com/2014/04/rec ... odb-mysql/

What do you suggest? I´m lost.
Thank you.


Top
   
PostPosted: Thu Jul 23, 2015 11:44 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
That only applies if the innodb log file is corrupt which probably won't help you since you've not shown any errors about innodb and unless you know what innodb is I doubt you're using it. Without looking at the server I can't make any suggestions.

For the future you should test backups regularly.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
PostPosted: Thu Jul 23, 2015 12:15 pm 
Offline
Senior Member

Joined: Fri Feb 11, 2011 1:36 pm
Posts: 118
What do you mean by testing backups?
I have backups enabled daily and always take a snapshot before an upgrade. It´s so strange that this time even my 2 months old snapshot didn´t work. The site "died" 2 weeks ago.
I can´t pay much obs, but could you help me?
Thanks


Top
   
PostPosted: Thu Jul 23, 2015 2:37 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Testing backups means restoring them to another node and making sure they work. In your case you should at least have a cron that runs
Code:
mysqldump --single-transaction -A > /root/backup.sql
before the backup runs before the Linode backups that way you have an easily to restore backup of the database.

Ping me an email at admin@rwky.net with your ssh details and I'll take a quick look, odds are I'll be able to tell you how knackered it is within a few minutes.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
PostPosted: Thu Jul 23, 2015 2:48 pm 
Offline
Senior Member

Joined: Fri Feb 11, 2011 1:36 pm
Posts: 118
Thanks a lot obs.
Sent you the email.


Top
   
PostPosted: Thu Jul 23, 2015 4:28 pm 
Offline
Senior Member

Joined: Fri Feb 11, 2011 1:36 pm
Posts: 118
Thank you obs, you saved my life!

Where do i place:
Code:
mysqldump --single-transaction -A > /root/backup.sql


Is it inside "crontab -e"?


Top
   
PostPosted: Thu Jul 23, 2015 5:50 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Yep that would do, for Ubuntu/Debian this would back up the database at 5am every day
Code:
0 5 * * * /usr/bin/mysqldump --defaults-extra-file=/etc/mysql/debian.cnf --single-transaction -A > /root/backup.sql


Obviously you'll want to change the time of day so it's just before your Linode backup window.

Also on another note, Linode backups are stored in the same DC as the host server so if there's a major inccident i.e. a fire you can potentiallly lose both the live site. You should copy your site files and database dump perodically to somewhere off site. At a minimum using rsync or sftp to download them to your local machine would do.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
PostPosted: Fri Jul 24, 2015 10:20 am 
Offline
Senior Member

Joined: Fri Feb 11, 2011 1:36 pm
Posts: 118
Thanks Rowan, great tips too.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
RSS

Powered by phpBB® Forum Software © phpBB Group