Menu

Restoring a MySQL (WordPress) database from .ibd Files

I have Apache and MySQL (XAMPP) running on my Windows PC, took backup of the \xampp\mysql\data\ folder and excluding any other files.

Bummer!!!, it simply not matter of pasting files (.frm and .ibd) to \xampp\mysql\data\mydatabase to get the database back.

Since this a WordPress site, I did the installation of WordPress and it created the database tables and now it’s just matter of restoring the data, data is in .ibd files.

First to prevent write operations for the table to be restored.

Issue this ALTER TABLE statement:

so you have both commands for all the tables like below

Now copy all the .ibd backup files to newly created database folder, replacing existing files.

Issue this ALTER TABLE statement:

Release the write lock to complete the restore procedure:

so you have both commands for all the tables like below

That is it.

Leave a comment