Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2006
    Posts
    10
    Plugin Contributions
    0

    Default Delet old orders

    Hi everyone
    I'm running an old store and have an abundance of old orders that would best be deleted, and deleting them one by one is rather tedious.

    Is there an easy way to delete all orders older than X with all entries in the orders_status/products/attributes/etc table or should I just go through phpmyadmin?

    or is this something yet to be done?

    Cheers

  2. #2
    Join Date
    Mar 2006
    Location
    Australia
    Posts
    289
    Plugin Contributions
    3

    Default Re: Delete old orders

    Hi there
    As far as I know you would need to use phpmyadmin.
    Howevere be aware that you would need to find each order in orders where purchase_date < xxxx-xx-xx, remember the orders_id and then delete all records with that orders_id from orders_products, orders_products_attributes, orders_status_history and orders_total. Do not touch orders_statues since this is the list of your order stratues.

  3. #3
    Join Date
    Nov 2006
    Posts
    10
    Plugin Contributions
    0

    Default Re: Delet old orders

    since order Id's are in time order as well i simply used this (just not sure if I missed any relevant tabletable):

    DELETE FROM `_orders` WHERE `orders_id`<X0000000;
    DELETE FROM `_orders_products` WHERE `orders_id`<X0000000;
    DELETE FROM `_orders_products_attributes` WHERE `orders_id`<X0000000;
    DELETE FROM `_orders_products_download` WHERE `orders_id`<X0000000;
    DELETE FROM `_orders_status_history` WHERE `orders_id`<X0000000;
    DELETE FROM `_orders_total` WHERE `orders_id`<X0000000;

  4. #4
    Join Date
    Mar 2006
    Location
    Australia
    Posts
    289
    Plugin Contributions
    3

    Default Re: Delet old orders

    Looks good to me.

  5. #5
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: Delet old orders

    Before deleting any orders - you may want to check with your accountant about how long you should hang onto your records.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  6. #6
    Join Date
    Nov 2006
    Posts
    10
    Plugin Contributions
    0

    Default Re: Delet old orders

    I export all orders anyways and there's always a DB backup that I can run on localhost so I don't see a problem there

    thanks for help

 

 

Similar Threads

  1. HOw to archive old orders?
    By ewalker3 in forum General Questions
    Replies: 3
    Last Post: 26 May 2010, 02:05 PM
  2. Old Orders Disappearing
    By SnowbankRobbery in forum Managing Customers and Orders
    Replies: 2
    Last Post: 28 Dec 2009, 04:06 AM
  3. Organizing old orders
    By getsome in forum General Questions
    Replies: 1
    Last Post: 12 Jan 2009, 01:24 PM
  4. delet word in sidebox information
    By samsign in forum Addon Sideboxes
    Replies: 2
    Last Post: 1 Dec 2008, 09:51 PM
  5. New Orders showing Old Orders
    By OJM in forum General Questions
    Replies: 4
    Last Post: 10 Jan 2008, 07:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg