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.

  • what do your mean by "remove table prefix"? You have tabels like "mg_catalog_...." and you want them to be "catalog_...."? – Marius Jul 16 '15 at 10:57
  • I thought it was important to add this. See my answer and add to it if you find necessary – snh_nl Jul 16 '15 at 10:59
  • This is not really magento related. it's a db related question. – Marius Jul 16 '15 at 11:00
  • Following Link could be helpful: - dba.stackexchange.com/questions/13259/… – Rahul Kumar Das Jul 16 '15 at 11:38
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

| improve this answer | |
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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.