Magento – Magento remove table prefix

database

We want to delete/remove the Magento table prefix.

How can this be done? Is there a script available to do this in one-go?

Essentialy changing the table myprefix_catalog_category to catalog_category

We have had the prefix since 1.3 – but it is causing us too much problems when running scripts or extensions where one forgot to respect it. Removing it seems a lot more logical then.

Best Answer

Steps:

  • Make a database backup
  • Disable caching
  • Save this file on your server (download here)
  • Edit settings in the file
  • Run the file in dryrun modus first (upload and run from browser)
  • If you are satisfied: change dryrun to false and run again
  • All done!
  • Go to app/etc/local.xml and modify the table prefix (to empty)

Don't forget to reset opcache and reset all caches before it will work.

  • Enable caching afterwards

You're done.

UPDATE. Script can be updated to support rename