2

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.

snh_nl
  • 5,442
  • 13
  • 69
  • 133

2 Answers2

2

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

snh_nl
  • 5,442
  • 13
  • 69
  • 133
2

In phpMyAdmin select all tables, then With Selected.. -> Replace table prefix would surely be quicker than an export and re-imports.

Then edit your local.xml

tecjam
  • 4,033
  • 3
  • 27
  • 48