WarpConduit Computing

  • Quick Tips
  • Web Development
  • WordPress Plugins
  • Home
  • Passphrase Generator
  • Password Generator
  • About
  • Contact

How to Change the Order Increment ID and Prefix in Magento

April 18, 2012 by Josh Hartman

Magento Order NumbersSometimes the need arises where you must change the Magento order numbering. Perhaps it is necessary to avoid conflict with a separate Magento installation or other ecommerce platform. Or maybe you just want to increase your order number to look like you’ve processed hundreds of thousands of orders. Whatever the case may be here are some SQL commands you can run to check the status of your store’s order numbers, and commands to also change the numbering. In addition, I’ve included SQL commands to modify the invoice, shipment, and credit memo increment IDs as well.

Note: These queries were tested on Magento Community Edition v1.6.2.0. I fully expect the increment ID queries to work on v1.4.1 and above, but DO NOT set the increment prefix to NULL on anything less than v1.6.0. Backup your database before making any changes in case your copy of Magento reacts unexpectedly.

Update 12/6/2017: This method has been successfully tested on Magento CE v1.9.3.6.

Find the Current Increment IDs for All Stores

SELECT core_store_group.name as group_name, core_website.name as website_name, core_store.name as store_name, core_store.store_id, increment_prefix, increment_last_id, entity_type_code
FROM eav_entity_store
INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
INNER JOIN core_store ON core_store.store_id = eav_entity_store.store_id
INNER JOIN core_store_group ON core_store_group.group_id = core_store.group_id
INNER JOIN core_website ON core_website.website_id = core_store.website_id
WHERE eav_entity_store.store_id != 0 ORDER BY eav_entity_store.store_id;

This will display your current increment ID and prefix for all document types (quotes, orders, invoices, shipments, and credit memos). In addition it will show you the website group, website name, store name, and store ID for each type of increment ID to help you in updating a specific store among multiple stores.
When making changes keep in mind that the increment_prefix field type is varchar(20) and that the increment_last_id field type is varchar(50).

Order Increment ID and Prefix

Change your Order Increment ID on All Stores

UPDATE eav_entity_store
INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_last_id='XXXXXXXXXX'
WHERE eav_entity_type.entity_type_code='order';

Replace the X‘s with your desired order number and run the query.

Change your Order Prefix on All Stores

UPDATE eav_entity_store
INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_prefix='X'
WHERE eav_entity_type.entity_type_code='order';

Replace the X with your desired order prefix or remove the quotes and set X to NULL (no quotes) to disable the order prefix, then run the query.

Change your Order Increment ID on a Specific Store

UPDATE eav_entity_store
INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_last_id='XXXXXXXXXX'
WHERE eav_entity_type.entity_type_code='order' AND eav_entity_store.store_id = 'Y';

Replace the X‘s with your desired order number, replace Y with the store ID of the store you want to modify, then run the query.

Change your Order Prefix on a Specific Store

UPDATE eav_entity_store
INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_prefix='X'
WHERE eav_entity_type.entity_type_code='order' AND eav_entity_store.store_id = 'Y';

Replace the X with your desired order prefix or remove the quotes and set X to NULL (no quotes) to disable the order prefix, then replace Y with the store ID of the store you want to modify. Run the query.

Invoice Increment ID and Prefix

Change your Invoice Increment ID on All Stores

UPDATE eav_entity_store
INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_last_id='XXXXXXXXXX'
WHERE eav_entity_type.entity_type_code='invoice';

Replace the X‘s with your desired invoice number and run the query.

Change your Invoice Prefix on All Stores

UPDATE eav_entity_store
INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_prefix='X'
WHERE eav_entity_type.entity_type_code='invoice';

Replace the X with your desired invoice prefix or remove the quotes and set X to NULL (no quotes) to disable the prefix, then run the query.

Change your Invoice Increment ID on a Specific Store

UPDATE eav_entity_store
INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_last_id='XXXXXXXXXX'
WHERE eav_entity_type.entity_type_code='invoice' AND eav_entity_store.store_id = 'Y';

Replace the X‘s with your desired invoice number, replace Y with the store ID of the store you want to modify, then run the query.

Change your Invoice Prefix on a Specific Store

UPDATE eav_entity_store
INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_prefix='X'
WHERE eav_entity_type.entity_type_code='invoice' AND eav_entity_store.store_id = 'Y';

Replace the X with your desired invoice prefix or remove the quotes and set X to NULL (no quotes) to disable the prefix, then replace Y with the store ID of the store you want to modify. Run the query.

Shipment Increment ID and Prefix

Change your Shipment Increment ID on All Stores

UPDATE eav_entity_store
INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_last_id='XXXXXXXXXX'
WHERE eav_entity_type.entity_type_code='shipment';

Replace the X‘s with your desired shipment number and run the query.

Change your Shipment Prefix on All Stores

UPDATE eav_entity_store
INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_prefix='X'
WHERE eav_entity_type.entity_type_code='shipment';

Replace the X with your desired shipment prefix or remove the quotes and set X to NULL (no quotes) to disable the prefix, then run the query.

Change your Shipment Increment ID on a Specific Store

UPDATE eav_entity_store
INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_last_id='XXXXXXXXXX'
WHERE eav_entity_type.entity_type_code='shipment' AND eav_entity_store.store_id = 'Y';

Replace the X‘s with your desired shipment number, replace Y with the store ID of the store you want to modify, then run the query.

Change your Shipment Prefix on a Specific Store

UPDATE eav_entity_store
INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_prefix='X'
WHERE eav_entity_type.entity_type_code='shipment' AND eav_entity_store.store_id = 'Y';

Replace the X with your desired shipment prefix or remove the quotes and set X to NULL (no quotes) to disable the prefix, then replace Y with the store ID of the store you want to modify. Run the query.

Credit Memo Increment ID and Prefix

Change your Credit Memo Increment ID on All Stores

UPDATE eav_entity_store
INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_last_id='XXXXXXXXXX'
WHERE eav_entity_type.entity_type_code='creditmemo';

Replace the X‘s with your desired credit memo number and run the query.

Change your Credit Memo Prefix on All Stores

UPDATE eav_entity_store
INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_prefix='X'
WHERE eav_entity_type.entity_type_code='creditmemo';

Replace the X with your desired credit memo prefix or remove the quotes and set X to NULL (no quotes) to disable the prefix, then run the query.

Change your Credit Memo Increment ID on a Specific Store

UPDATE eav_entity_store
INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_last_id='XXXXXXXXXX'
WHERE eav_entity_type.entity_type_code='creditmemo' AND eav_entity_store.store_id = 'Y';

Replace the X‘s with your desired credit memo number, replace Y with the store ID of the store you want to modify, then run the query.

Change your Credit Memo Prefix on a Specific Store

UPDATE eav_entity_store
INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_prefix='X'
WHERE eav_entity_type.entity_type_code='creditmemo' AND eav_entity_store.store_id = 'Y';

Replace the X with your desired credit memo prefix or remove the quotes and set X to NULL (no quotes) to disable the prefix, then replace Y with the store ID of the store you want to modify. Run the query.

Filed Under: Web Development Tagged With: credit memo, increment, invoice, magento, number, order, prefix, shipment, sql

How to Reset your Lost or Forgotten WordPress Admin Login Password with wp_set_password

April 17, 2012 by Josh Hartman

Lost PasswordLet me guess…you’ve lost your WordPress admin password, you have no other admins to recover it, and you don’t have access to the admin email account either? Well I hope that you haven’t gotten yourself stuck in that sorry situation, but in case you have go ahead and do this:

Open your site through FTP or cPanel File Manager and add this line just inside the closing ?> of your site’s wp-login.php file (found in the root of your installation):

wp_set_password('foobar',1);

Now, open up a browser go to your WordPress site’s login page (/wp-login.php or /wp-admin) and login using your new password (foobar in this case).

At this point you need to remove the wp_set_password line from wp-login.php and then you’re done. You can now change your password from within the WordPress admin.

The first parameter is the new password you would like to set, and the second parameter is the WordPress user ID. If you need to lookup your user ID connect to your WordPress database using phpMyAdmin or another SQL client and look in the wp_users table.

I’m not sure why the Internet is full of pages suggesting running SQL commands, that hasn’t worked for a while since the passwords are not stored using the MD5 algorithm anymore. Even the WordPress Codex has outdated methods, although it does include the method I have shown you.

Happy log-ins WordPress travelers!

Filed Under: Web Development Tagged With: admin, login, lost, password, reset, wordpress, wp_set_password

Quick Tip: Convert Embedded PDF Fonts to Outlines with Illustrator

March 7, 2012 by Josh Hartman

In today’s quick tip screencast you’ll learn how to take a PDF logo containing an embedded font you don’t have and preserve it by converting the font to outlines using the flatten transparency feature in Adobe Illustrator.

View Screencast

Filed Under: Graphic Design, Quick Tips Tagged With: convert, font, illustrator, pdf

PHP 5.4.0 Released

March 2, 2012 by Josh Hartman

PHP 5.4 has finally been released as a stable version. It will no doubt take a while for shared hosting to upgrade, but for those of you under control of your own hosting environment can enjoy it now.

Say hello to traits, a short array syntax, $this for closures, and a built-in web server for testing.

Say goodbye to safe mode, magic quotes, register_globals, and import_request_variables. Wonderful news!

Learn more:

  • New features
  • Backward Incompatible Changes

Filed Under: Annoucements, Web Development

  • « Previous Page
  • 1
  • …
  • 3
  • 4
  • 5
  • 6
  • 7
  • …
  • 12
  • Next Page »

Connect

  • Facebook
  • GitHub
  • RSS
  • Twitter
  • YouTube

Recent Posts

  • How to Permanently Remove the “Learn about this picture” Spotlight Wallpaper Icon From Your Windows Desktop
  • How to Quickly Test a Fax Machine
  • Extremely Useful Applications for Web Development and IT Tasks

Tags

automatic benchmark bigint class composer css embed escape event font function gzip helper htaccess html htmlspecialchars image increment javascript jquery list magento media mysql number observer opencart order output photo php profiling random redirect rijndael software text type ubuntu url windows windows 7 wordpress xampp xss

Blogroll

  • CodeIgniter
  • Fusion Forward
  • jQuery
  • Nettuts+
  • Smashing Magazine

© 2025 WarpConduit Computing. All Rights Reserved.