Install – How to Recover Accidentally Deleted local.xml File

installlocal.xml

I've accidentally deleted my local.xml file. So, site stopped working. I tried to use the local.template.xml file and added the db settings, but then the front-end started giving this error.

Fatal error: Class 'Mage_GoogleCheckout_Model_Resource_Setup' not found in /home4/dezyner/public_html/demo/menstyle3/app/code/core/Mage/Core/Model/Resource/Setup.php on line 234

Then I deleted the var folder, and deleted the local.xml file again, so that i could fresh install using magento install wizard. When i refresh front-end, the url changes from http://demo.webdezyner.com/menstyle3/index.php/ to http://demo.webdezyner.com/menstyle3/index.php/install but the page keeps on loading, and give this error:

The page isn't redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

This problem can sometimes be caused by disabling or refusing to accept cookies.

Can anyone help me here.

Best Answer

If you don't have a backup (e.g. in git) you're in a quite difficult situation.

Try the following:

  • Delete the cache (var/cache/ if you don't use something else as the cache backend).
  • Add the local.xml template: https://gist.github.com/thebod/9001682 to app/etc/
  • Clean your browser cache (to prevent redirects cached by the browser)
  • Open the /install again and do the installation
  • You should now have a working local.xml again and the shop should work

But note: Because the local.xml is gone the encryption key is gone as well, that means every encrypted configuration option, credit card, etc. can't be decrypted anymore! Cracking the encryption key would work, but requires some knowledge about crypto, so that would probably not an option for you.

Related Topic