Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-11-2008, 02:56 PM
Dan@TT Dan@TT is offline
 
Join Date: Feb 2007
Location: Europe
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help me restore by database

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
Reply With Quote
  #2  
Old 02-11-2008, 03:07 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #3  
Old 02-11-2008, 03:10 PM
Dan@TT Dan@TT is offline
 
Join Date: Feb 2007
Location: Europe
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

no. no mysqldump backup.

--------------- Added [DATE]1202752564[/DATE] at [TIME]1202752564[/TIME] ---------------

Any other hints ? I know I'm dumb for not keeping a proper database backup but I really need your help
Reply With Quote
  #4  
Old 02-11-2008, 05:18 PM
valdet's Avatar
valdet valdet is offline
 
Join Date: Feb 2007
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 02-11-2008, 05:53 PM
bobster65's Avatar
bobster65 bobster65 is offline
 
Join Date: Mar 2006
Location: Montana
Posts: 1,169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dan@TT View Post
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 [DATE]1202759912[/DATE] at [TIME]1202759912[/TIME] ---------------

Quote:
Originally Posted by valdet View Post
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)
Reply With Quote
  #6  
Old 02-11-2008, 06:14 PM
Dan@TT Dan@TT is offline
 
Join Date: Feb 2007
Location: Europe
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by valdet View Post
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.

Quote:
Originally Posted by bobster65 View Post
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 [DATE]1202759912[/DATE] at [TIME]1202759912[/TIME] ---------------



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)
Reply With Quote
  #7  
Old 02-11-2008, 06:27 PM
bobster65's Avatar
bobster65 bobster65 is offline
 
Join Date: Mar 2006
Location: Montana
Posts: 1,169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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..
Reply With Quote
  #8  
Old 02-11-2008, 07:00 PM
snakes1100 snakes1100 is offline
 
Join Date: Dec 2001
Location: Michigan
Posts: 3,733
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 02-11-2008, 08:00 PM
Dan@TT Dan@TT is offline
 
Join Date: Feb 2007
Location: Europe
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Tried both. No results. Is it possible that some files might have been transferred as corupt ?
Reply With Quote
  #10  
Old 02-11-2008, 08:19 PM
bobster65's Avatar
bobster65 bobster65 is offline
 
Join Date: Mar 2006
Location: Montana
Posts: 1,169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dan@TT View Post
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:17 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03949 seconds
  • Memory Usage 2,266KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete