Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2009
    Posts
    35
    Plugin Contributions
    0

    Default Deleting old order records and customers

    I've been running zen-cart for a few years and the database has grown larger than my hosting provider will automatically back up or allow me to import.

    I would like to delete old order records from years ago, and maybe customers who have not ordered for years.

    Can I just delete them via PHPMyAdmin or will this mess up lots of database linkages?

    Is there anything else I can delete from the database that isn't of use, like old log entries. I do clear up the stuff in Store Manager regularly already.

    Thanks in advance,

    Chris

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,478
    Plugin Contributions
    88

    Default Re: Deleting old order records and customers

    Quote Originally Posted by devus View Post
    I've been running zen-cart for a few years and the database has grown larger than my hosting provider will automatically back up or allow me to import.

    I would like to delete old order records from years ago, and maybe customers who have not ordered for years.

    Can I just delete them via PHPMyAdmin or will this mess up lots of database linkages?

    Is there anything else I can delete from the database that isn't of use, like old log entries. I do clear up the stuff in Store Manager regularly already.

    Thanks in advance,

    Chris
    First, make a backup of your current database.

    Do not use phpmyadmin to remove/delete the records! There are many intertwined entries for a customer and an order; you should use your Zen Cart admin's Customers->Customers and Customers->Orders to remove the customers and orders, respectively, one at a time. It could be time-consuming, but going through the process that way will make sure that your database is intact when the process is completed.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Deleting old order records and customers

    Deleting customers and orders will probably not reclaim all that much space.
    But pruning the Admin Activity Log (after a backup) and the Email Archive (if you've got it enabled) will clear up a LOT of space.
    Same with cleaning out old .log files from your /cache/ and /includes/modules/payment/paypal/logs/ folders.
    And deleting old image files you're no longer using.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4

    Default Re: Deleting old order records and customers

    Here's method to find out which tables actually take most space. Execute the query in phpmyadmin, it'll return list of tables sorted by their size in descending order:

    Code:
    SELECT ( (t.DATA_LENGTH + t.INDEX_LENGTH)/(1024*1024)) as 'total_size_mb', t.*
    FROM INFORMATION_SCHEMA.TABLES t
    WHERE TABLE_SCHEMA LIKE 'name_of_your_database'
    ORDER BY (DATA_LENGTH + INDEX_LENGTH) DESC
    If Your database takes less than few gigabytes I would look for another hosting company.

  5. #5

    Default Re: Deleting old order records and customers

    I forgot to mention, that chances are that You're allowed only allowed to view Your schemas portion of the INFORMATION_SCHEMA database and You don't have to put even 'name_of_your_database'. Just copy & paste & execute in phpmyadmin:

    Code:
    SELECT ( (t.DATA_LENGTH + t.INDEX_LENGTH)/(1024*1024)) as 'total_size_mb', t.*
    FROM INFORMATION_SCHEMA.TABLES t
    ORDER BY (DATA_LENGTH + INDEX_LENGTH) DESC

 

 

Similar Threads

  1. Deleting Really Old Customers, Orders, etc
    By Doodlebuckets in forum Managing Customers and Orders
    Replies: 7
    Last Post: 21 May 2010, 04:03 PM
  2. WARNING: The Admin Activity Log table has records over 2 months old and...
    By Agent_KGB in forum Customization from the Admin
    Replies: 1
    Last Post: 28 Mar 2009, 04:50 PM
  3. removing old customer records
    By trillian in forum General Questions
    Replies: 2
    Last Post: 21 Nov 2008, 10:35 PM
  4. error when deleting old customers
    By godin5150 in forum General Questions
    Replies: 1
    Last Post: 30 Sep 2007, 03:05 AM
  5. Importing old customers and orders into new cart
    By Siren Sub in forum Basic Configuration
    Replies: 0
    Last Post: 29 Nov 2006, 09:46 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR