View Full Version : Help me restore by database
Dan@TT
02-11-2008, 02:56 PM
Hi
I had a major breakdown of the linux server 4 days ago , yesterday however I've managed with the guys from the hosting company to recover some data from the crashed hdd.
I basically got the entire httpdocs folder , including all the forum files + the complete forum database located in /var/lib/mysql/forumname
the files located in this folder /var/lib/mysql/forumname look like this:
access.frm
access.MYD
access.MYI
....
etc.
Now the server got a new HDD, everything was reinstalled from zero. I've set up the server again from Plesk CP, created a new mysql database with the same name like the old one, same username & password to access the mysql database.
After, I went to /var/lib/mysql/forumname and put back all the previously saved files and I hoped it will work.
It doesn't work. I got Database error when trying to access the forum.
What am I doing wrong ?
Daniel
Lynne
02-11-2008, 03:07 PM
You may have to go into your database (through phpMyAdmin or cPanel) and repair/optimize the tables.
Do you not have an actual real backup of the site - a mysqldump?
Dan@TT
02-11-2008, 03:10 PM
no. no mysqldump backup.
--------------- Added 1202752564 at 1202752564 ---------------
Any other hints ? I know I'm dumb for not keeping a proper database backup but I really need your help
valdet
02-11-2008, 05:18 PM
If I am not wrong, those are raw database backup files, so you cannot restore them from phpmyadmin, but only from SSH.
I think your hosting guys can do that restore pretty easily.
Regards,
Val.
bobster65
02-11-2008, 05:53 PM
Hi
I had a major breakdown of the linux server 4 days ago , yesterday however I've managed with the guys from the hosting company to recover some data from the crashed hdd.
I basically got the entire httpdocs folder , including all the forum files + the complete forum database located in /var/lib/mysql/forumname
the files located in this folder /var/lib/mysql/forumname look like this:
access.frm
access.MYD
access.MYI
....
etc.
Now the server got a new HDD, everything was reinstalled from zero. I've set up the server again from Plesk CP, created a new mysql database with the same name like the old one, same username & password to access the mysql database.
After, I went to /var/lib/mysql/forumname and put back all the previously saved files and I hoped it will work.
It doesn't work. I got Database error when trying to access the forum.
What am I doing wrong ?
Daniel
Well, the first thing that I see that your .frm .MYI and .MYD are not located in its own database directory. Each DB managed by the MySQL Server has its own database directory. This exists as a subdirectory of the data directory, with the same name as the database it represents. ie .. /var/lib/mysql/forumname/DATABASE_NAME
In your case (as described above), you have an RPM installed MySQL as the data directory is located at /var/lib/mysql/forumname so within that directory, you should have a folder for each database and within that specific DB folder is where those files should be located..
NOW, you mentioned that you "created a new mysql database with the same name like the old one" Is there now a Folder in the var/lib/mysql/forumname directory with that database name? if so, move all those .frm .MYI and .MYD files into that directory.
the .frm files are called Form Files. They describe the structure of the table (its Columns, column types, indexes and so forth)
the Data Files .MYD (MyISAM) OR .ISD (ISAM) contain the table's data -- that is, its rows
the Index files .MYI (MyISAM) OR .ISM (ISAM) contain the index trees from any indexes on the data file. The index file exists whenther or not the table has any indexes...
Let me know if you have a database sub folder for the new data base you created (or if there are any other sub folders in the /var/lib/mysql folder.
--------------- Added 1202759912 at 1202759912 ---------------
If I am not wrong, those are raw database backup files, so you cannot restore them from phpmyadmin, but only from SSH.
I think your hosting guys can do that restore pretty easily.
Regards,
Val.
no, those are the actual files themselves that make up the database. Each table within a database exists as 3 files in the database directory (A Form File ie access.frm , a Data file ie access.MYD and a index file ie access.MYI)
Dan@TT
02-11-2008, 06:14 PM
If I am not wrong, those are raw database backup files, so you cannot restore them from phpmyadmin, but only from SSH.
I think your hosting guys can do that restore pretty easily.
Regards,
Val.
It's a self administered sever. They refused to help.
Well, the first thing that I see that your .frm .MYI and .MYD are not located in its own database directory. Each DB managed by the MySQL Server has its own database directory. This exists as a subdirectory of the data directory. In your case, you have an RPM installed MySQL as the data directory is located at /var/lib/mysql so within that directory, you should have a folder for each database and within that specific DB folder is where those files should be located..
NOW, you mentioned that you "created a new mysql database with the same name like the old one" Is there now a Folder in the var/lib/mysql directory with that database name? if so, move all those .frm .MYI and .MYD files into that directory.
Did exactly this. Got no luck.
the .frm files are called Form Files. They describe the structure of the table (its Columns, column types, indexes and so forth)
the Data Files .MYD (MyISAM) OR .ISD (ISAM) contain the table's data -- that is, its rows
the Index files .MYI (MyISAM) OR .ISM (ISAM) contain the index trees from any indexes on the data file. The index file exists whenther or not the table has any indexes...
Let me know if you have a database sub folder for the new data base you created (or if there are any other sub folders in the /var/lib/mysql folder.
Yes , there is a single subfolder, my new emtpy database where I put the old files.
--------------- Added 1202759912 at 1202759912 ---------------
no, those are the actual files themselves that make up the database. Each table within a database exists as 3 files in the database directory (A Form File ie access.frm , a Data file ie access.MYD and a index file ie access.MYI)
bobster65
02-11-2008, 06:27 PM
Yes , there is a single subfolder, my new emtpy database where I put the old files.
OK, well that right there is a HUGE problem. There should be at least a folder named mysql as well and within that folder will be .frm, .MYI and MYI files that store things such as the myselq users and passwords..
THAT is HUGE issue if that is missing..
snakes1100
02-11-2008, 07:00 PM
You dont need to replace the mysql folder, once mysql is installed, the folder & mysql default db will be installed and operational, you just need to set the root mysql passwd, then open your vb config.php file and add your user info back via mysql cmd line or using phpmyadmin.
Dan@TT
02-11-2008, 08:00 PM
Tried both. No results. Is it possible that some files might have been transferred as corupt ?
bobster65
02-11-2008, 08:19 PM
Tried both. No results. Is it possible that some files might have been transferred as corupt ?
Its possible..
Did you reinstall mysql as Snakes suggested? By doing that, you will at least know that all the working guts of mysql are present and working.. then it would just be a matter of creating the database again (which will create a empty subfolder in the data directory) and then put all of those files in that folder.
I just made 3 clones of my DB by simply copying all of the files out of my main DB, created 3 new DBs from phpmyadmin .. then copied all the files into those 3 new folders. The all worked perfectly.
Guest210212002
02-11-2008, 08:22 PM
It's a self administered sever. They refused to help.
I have no input to the MS side of things because I'm a Linux guy, but as for this - get a new host, or email their support telling them that you're looking. My hosting company would do this for me 24/7, without question.
Dan@TT
02-11-2008, 08:26 PM
It's a self administered server... they won't help.
Guest210212002
02-11-2008, 08:30 PM
It's a self administered server... they won't help.
That's what I mean - imo, once you get it sorted out, take your business elsewhere. Didn't mean to derail your thread though - good luck, just wish I could be of assistance but as I said, I'm a linux guy. :(
bobster65
02-11-2008, 08:33 PM
It's a self administered server... they won't help.
Thats messed up.. so you ahve a Hard Drive that Crashes, they help you with that and then tell you that you are SOL because its a self administered server.. terrible host. If I were you, I would take your business elsewhere..
There are plenty of people here that can help you reinstall MySQL tho bud.
Dan@TT
02-11-2008, 09:01 PM
I will recreate the forum from zero. Lost 23,000 members in one day. Not that I was getting any benefits but its sad.
valdet
02-11-2008, 10:29 PM
I will recreate the forum from zero. Lost 23,000 members in one day. Not that I was getting any benefits but its sad.
Its your call, but a better option would be to move to another server and ask them to restore from that backup. Just like many suggested, why would you lose so many members and all the hard work you were probably putting.
Most of us can only dream of having 23.000 members and destroying it only because of your hosting is a terrible decision.
Just my 2c..
bobster65
02-11-2008, 11:13 PM
I will recreate the forum from zero. Lost 23,000 members in one day. Not that I was getting any benefits but its sad.
I don't know how you are going to accomplish that with out first fixing mysql itself. You still need to somehow restore the mysql database itself as that contains the users table that drives mysql to begin with. Once you get THAT fixed, then the other stuff will work ;)
Like I said, there are people here willing to help, don't just give up. That is a heck of a lot of users to give up on.
snakes1100
02-11-2008, 11:41 PM
yes, that is not the route to take, this is easily fixable whether it be on a linux box or a winblowz server, fix mysql and your all set, as long as the actual db files are good.
Eikinskjaldi
02-12-2008, 01:04 AM
I loathe mysqldump, and always do backups via moving the raw .frm,MYI and MYD files around, including using mysqlhotcopy.
Restoring your db should not be an issue, I have restored from a fatal disk crash from these backups.
It would really help us help you if you mentioned exactly what errors you are getting, and also if there are any errors in the mysql error file
Did you lose my.cnf as well?
Marco van Herwaarden
02-12-2008, 11:42 AM
If you try to restore a database with the raw files, then ensure that:
- MySQL server is stopped while restoring the files.
- User/group/permissions are set correct on the files/directory.
It might not work, but that is your best chance.
valdet
02-15-2008, 07:01 PM
Sorry to bump this out.
Dan@TT, did you manage to sort your problems with host..?
Guest210212002
02-15-2008, 09:07 PM
I know my host does a backup of my VPS once a week. Check if they do the same, I'd have to assume they do because if a drive dies, there really isn't much you can do remotely. If they seriously can't roll you back to THEIR last backup, please tell us which host you use so that we can all avoid it like the plague. :\
Best of luck man, hope you get it sorted.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.