Mysql – Restoring a WordPress site from WAMP with only .ibd and .frm files, into a new WAMP with … .thed and .thei files


Background: I uninstalled a WAMPserver (version 2.5) on a PC, which left over a WordPress installation with only .frm and .ibd and .opt files. That's it. I need to restore the site.

My latest attempt to restore the site is based on a method I read at this link, where:

  1. I install a fresh installation of WAMP (version 3 this time)
  2. I install a WAMP add-on of MySQL 5.6.12, which is the version of MySQL that my site was running on before my WAMP failure.
  3. Install WordPress as a fresh new install.
  4. Copy all the .ibd, .opt, and .frm files left over from the old setup, and replace the fresh .ibd, .opt, and .frm files in the new setup.
  5. Go into PHPAdmin, access the database and run "alter table" comments for each wordpress table (ex.: alter table wp_posts import tablespace;)

I copied the left over .ibd, .opt, and .frm files from the old setup, and then went over to the new database folder and was surprised to find that there were not .ibd files in there to replace but .myd and .myi files instead!

I find this confusing because I learned that I had to have the same version of MySQL running to attempt this.

My questions are this:

1) why did my new installation create dual .myd and .myi files for each database table instead of single .ibd files?

2) am I able to replace the files anyway, with the hopes of having the new setup read the old .ibd files and working them into the new .myi and .myd files

3) is there no hope of restoring this site now? This would appear to be my last hope before I'd have to resort to copying the paragraphs out of the .ibd files using TextWrangler to convert them into a text file in order to at least get my content back in some form.

Best Answer

.myd and .myi files are the data and index files for MyISAM database engines. There is nothing wrong with them being there. They won't affect in any way your Innodb files that you are copying. They don't have to be overwritten if you copy the files into the folder.

In my installation of wampserver the MyISAM files (myd and myi) are one folder deeper than the ibdata1 file. That folder name should be the name of your database. If its not there then create the folder with the database name.

Copy the data that you have over. This probably won't worth without ibdata, but just in case, after copying the other files into the appropriately named folder, click the wamp icon in the bottom right of the screen and select my.ini. Add the line:

innodb_force_recovery = 1

Restart wamp server. Let me know if your database is able to actually get anything out of the files you copied over.