Repair a Magento Database
There are many instances, where your Magento database can get corrupt and you will start getting a lot of errors on your Magento installation.
And its a bad idea to waste days and days trying to fix the database yourself, because you may end up with a completely broken website.
So, here is a workaround :
Magento Core Team has gave a nice database repair tool, which helps a big time.
You can download it here.
And now the step by step method :
- Download and unzip the Database Repair Tool . You will get a php file. Just place the php file somewhere on your server, so you can access it on browser.
- EXPORT your current database and make sure, you check the option, “DISABLE FOREIGN KEY CHECKS”
- Import the exported database from Step 2 to a new database.
- Install Magento latest version on a new database.
- Now open the repair tool php file on your browser.
- It will ask for database credentials for the CORRUPT DATABASE and REFERENCE DATABASE.
- Just enter the database details from Step 3 , to the CORRUPT DATABASE field.
- Enter the newly installed magento database details from Step 4 , to the REFERENCE DATABASE field.
- Click SUBMIT and wait for the success page.
- This will fix all of your database errors and all from your database and make it ready.
- Now, goto your own website ‘s folder, var/cache and delete all the folders inside it.
- Goto app/etc/local.xml and edit the database name and make it to the new database, which was done in Step 2.
- Access your website on browser now.
- You are done.