How do I set/reset the starting order number for my store?

Last updated on
27 October 2017

Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites

Orders are numbered sequentially, starting at number "1" for a new installation of Ubercart. After testing your new installation you will probably want to reset the first order number to a different value - to pick up where your old e-commerce system left off, for example, or simply because single-digit order numbers give the wrong (or right?) impression to your customers.

Ubercart stores order numbers in the database, so to change the order number you have to make a change to the database. The needed change depends on which version of Ubercart and Drupal you're using and is described in detail below. In all cases, be sure to take your site off-line before you modify the database - you don't want to interfere with an order in progress!

Order numbers are stored as unsigned 32 bit integers so the maximum order number you can use is 4294967295.

Your site's current order number is stored in the database in an autoincrement database field. You can use a tool like phpMyAdmin to alter the value stored in this row, or you can execute the following SQL. In this example, we will set the new starting order number to "1234":

ALTER TABLE uc_orders auto_increment = 1233;

Note that the next order placed will be one greater than the number stored in this table, so if we want to start at "1234" we set the column to be "1233." Your new starting order number must be higher than any existing order numbers!

Warning: InnoDB's resets auto_increment values when it's (re)started. It adds one to the max existing value. A work around is to create a dummy order.

Help improve this page

Page status: No known problems

You can: