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!