Clearing down test orders in Ubercart

Setting up and testing a Drupal 6 + Ubercart site with a payment service provider can result in a lot of test orders on the system so here's a quick procedure for clearing them down before handing the site over to the client.

Use at your own risk and ensure you have a back up of your database before you start!

Back up your database.
No really, back up your database, if you make a mistake here your data is gone bye-bye!

Okay, now we can begin.

We'll be using the TRUNCATE TABLE command which in most instances drops and re-creates the table with the original schema preserved.

These are the commands to enter at the MySQL command line:

USE `your_database`;
TRUNCATE TABLE uc_order_admin_comments;
TRUNCATE TABLE uc_order_comments;
TRUNCATE TABLE uc_order_line_items;
TRUNCATE TABLE uc_order_log;
TRUNCATE TABLE uc_order_products;
TRUNCATE TABLE uc_order_quotes;
TRUNCATE TABLE uc_orders;

And that's it for the clear down. I'd recommend entering a few more orders to make sure nothing got broke and then perform the clear down one last time.

Ubercart 6.x-2.0 was the current version at the time of writing.

Comments

Oooo thanks for the tip, my first Ubercart site is hopefully going up next week. Couldn't have come at a better time!

Which payment gateway are you using?

Cheers

George
(Fellow Parisian DC'er!)

Hi George, we're using RBS Worldpay so the uc_worldpay module came in real handy!

Good luck with your site :)

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.