MySQL – How to Change Store ID Value in Database

databaseMySQLstore-id

I'm working on a store with one store which has store id = 1. I want to write a db query that will update this id to something else (say 9 for example). Which table should I look for to edit this and will I need to update any other tables that may already have used the store id for cross referencing purposes such as with products and categories related tables?

Any hints on the tables I should look at and with the query would be greatly appreciated.

Best Answer

Normally you should update only the table core_store.
All the other tables have constraints to the core_store table with ON UPDATE CASCADE.
You have to look in the MyISAM tables for store id references and update those.
For example catalogsearch_fulltext.
But please back up before changing anything.