Changing starting order number?
I recreated my store from UC to Commerce and i think the last thing I need to do is start the order numbers at a specific number. I couldn't get the migration to work so I just opted for a complete rebuild. But now I have no orders. Not a big problem if I can manage this task.
Thanks
Comments
WARNING: I've never done
WARNING: I've never done this. It might end the world or explode your database server. It might break Commerce or Drupal or both and make you cry.
However, what if you ran the SQL query "ALTER TABLE commerce_order AUTO_INCREMENT = 1000;" That might do the trick. Heck, now I'm curious. I'm gonna go try it right now : ).
EDIT:
If you backup your database before doing this you won't have to worry so much :)
It works
Just wanted to chime in and say that, as far as I can tell, this works fine. One thing to note is that, if you have items in a cart before doing this with a certain user account or browser session and complete checkout after changing the auto_increment, that order will be completed with its original, lower order number since the order # is assigned once items are placed in a cart. Any new orders, however, will have the new higher number.
Fantastic. It looks like it
Fantastic. It looks like it works. If you have a database prefix you're using for your Drupal install you'll probably have to stick that in front of "commerce_order" in that query. I haven't tested this at all beyond seeing that the next order I created was order 1000. I can't imagine anything being broken by this but who knows.
(Change 1000 to whatever you want the next order to be)
Thanks PM
I will give it a try a little later and report back. Don't worry, I do backup the database. :D
Just a quick note to say
Just a quick note to say thanks and to confirm that that the solution in this thread works fine on my Drupal Commerce site.
Thanks for the solution and
Thanks for the solution and the feedback, everyone. I've gone ahead and migrated this discussion to the FAQ tag of the new Commerce Q&A section, so if you had the same question or found the solution helpful, it'd be great if you could go upvote them here:
http://www.drupalcommerce.org/questions/3172/how-can-i-change-starting-o...