Join over 10,000 ecommerce enthusiasts who receive free updates
Get email updates
Build A "Smarter"
Magento Store
Magik Extra Fees Create unlimited number & types of extra fees and charges to drive increased revenue per order.
$199  $99

Most popular posts

How To Repair A Database With Magento Repair Tool

 

Have you ever witnessed a scenario where your Magento store’s database or tables got corrupt? The most sane way to fix the issue is to download Magento database repair tool and get them fixed. If you are using Magento Database backup extension you can simply reload the database from your backed up copy (easy isn’t it?) but if you aren’t using this extension you can still use Magento repair tool to repair your database.

Magento Database Repair tool compares 2 databases i.e. Corrupt and target (reference) databases. Magento database repair tool will compare and from the reference database it fixes the corrupt database. Technically it does the following:

  • Check for missing tables and add them, repair corrupt tables and keep charset and engine type same
  • Check for missing fields in tables then repair or fix them
  • Check for broken foreign key references and get rid of inconsistent data from tables
  • Check for missing indexes, foreign keys and add them accordingly

Download Magento Database Repair Tool

You will find Magento Database Repair Tool here. Always download the latest version.

Every Magento powered store should keep Magento database repair tool handy, so if discrepancies occur in their store’s database they can easily correct it without jumping into MySQL world altogether.

How To use Magento Database Repair Tool

Using Magento Repair Tool is pretty easy. Magento Repair tool requires you to install the same Magento version on clean database (new database as new install) keep this new database as reference and your store’s corrupt database as corrupted. Once this is defined you don’t have to do anything and Magento Repair tool will compare corrupt database with reference database and fix all discrepancies.

Caution: If it’s your first time don’t run this tool directly on Production. Try this on staging and if everything works out run it on production cautiously. Also put your site under temporary maintenance mode while running this tool.

Let’s begin repairing a corrupt database.

  1. Download Magento database repair tool archive from the download page
  2. Uncompress the database repair tool archive
  3. Put the magento-db-repair-tool-1.1.php into any folder on your server
  4. Don’t forget to backup your existing database for emergencies.
  5. Clone it as new database on the same server. Let’s call it db2
  6. Create an empty database db3
  7. Either copy your entire Magento folder (without cache and sessions) into a new one and install there into db3 (By editing local.xml with credentials for the newly created db3)
  8. Or if you already restricted access to your Magento instance, you may just change your database credentials into db3, clean cache and launch Magento once: it will be installed automatically.

At this point you should have the clone of your original database in db2 and a brand new db3 with empty Magento installed.

  1. Call this url in your browser http://www.yourdomain.com/path-to-folder/magento-db-repair-tool-1.1.php
  2. Enter access credentials to db2 as corrupted database and to db3 as reference database
  3. Set table prefixes as applicable
  4. Press Continue and you will see result screen where you will see what was done to the corrupted database.

Magento database repair tool
 

What happened in the background of Magento Database Repair Tool

When you run Magento database repair tool, it will present the report and this is how you should interpret what it means:

  1. Your database doesn’t require any fix – you will see nothing was changed
  2. Only table charset was changed — usually there is no need to worry about it, especially if these tables don’t have text data
  3. Table engine was changed from MyIsam to InnoDb — major issue. Ask your Magento developer to investigate the issue.
  4. Added missing foreign key or field (or even a table!) — major/fatal issue. Ask your Magento developer to fix the issue.

Similarly, you can proceed and do the same steps on your production database and perform repair. Delete the file magento-db-repair-tool-1.1.php from your server as soon as you are done.

We would love to hear your experiences of using Magento database repair tool, please leave us a comment and let us know. Subscribe our RSS to receive latest updates.

 
Enjoyed this Post?
Then you can follow us here:

Subscribe to RSS
Follow us on Twitter
Follow us on Facebook

Ashish Nayyar

Chief Product Officer & Architect. MagikCommerce.com

Build A "Smarter" Magento Store
Magik Extra Fees Magik Extra Fees is the #1 extention for creating unlimited number & types of extra fees and charges to drive increased revenue per order.
  • Extra Fee for Products
  • Extra Fee for Categories
  • Extra Fee for Shipping
  • Multiple Additional Charges
$199  $99