Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Magento: Update Order Numbers SQL
-- Update Order increment id to start at 123456789
UPDATE `eav_entity_store` SET `increment_last_id` = '123456789' WHERE `entity_type_id` = '5';`
-- Update Invoice increment id to start at 123456789
UPDATE `eav_entity_store` SET `increment_last_id` = '123456789' WHERE `entity_type_id` = '6';
-- Update Credit Memo increment id to start at 123456789
UPDATE `eav_entity_store` SET `increment_last_id` = '123456789' WHERE `entity_type_id` = '7';
-- Update Shipment increment id to start at 123456789
UPDATE `eav_entity_store` SET `increment_last_id` = '123456789' WHERE `entity_type_id` = '8';
-- Update Order increment id to start at 012345678
UPDATE `eav_entity_store` SET `increment_last_id` = '012345678', `increment_prefix` = '0' WHERE `entity_type_id` = '5';
-- Update Invoice increment id to start at 012345678
UPDATE `eav_entity_store` SET `increment_last_id` = '012345678', `increment_prefix` = '0' WHERE `entity_type_id` = '6';
-- Update Credit Memo increment id to start at 012345678
UPDATE `eav_entity_store` SET `increment_last_id` = '012345678', `increment_prefix` = '0' WHERE `entity_type_id` = '7';
-- Update Shipment increment id to start at 012345678
UPDATE `eav_entity_store` SET `increment_last_id` = '012345678', `increment_prefix` = '0' WHERE `entity_type_id` = '8';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment