Magento 1.7 – How to Change Category IDs

categorydatabasemagento-1.7

We need to change the category ids on our store.

For example, our category of "automotive" was assigned a category ID of 129 and we would like that category to have the ID 268.

What is the best way to go about this and are there any risks associated?

Best Answer

If you want to do this then there will be lots of issues.

The category main table is catalog_category_entity. You need to change the category id in its primary key field entity_id.

There are multiple tables that reference this key:

  • the category and product relation table catalog_category_product
  • the catalog price rules table
  • the EAV value tables:

    • catalog_category_entity_datetime

    • catalog_category_entity_decimal

    • catalog_category_entity_int

    • catalog_category_entity_text

    • catalog_category_entity_varchar

You can try it, on your risk. But please take a backup first!

Related Topic