Zen Cart Logo
Forums / General Questions / Orders not showing in admin after db cleanout - HELP PLEASE

Orders not showing in admin after db cleanout - HELP PLEASE

Locked

Views: 1,230

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
29 Apr 2008, 7:20 AM
#1
emtecmedia avatar

emtecmedia

Zen Follower

Join Date:
May 2005
Posts:
108
Plugin Contributions:
0

Orders not showing in admin after db cleanout - HELP PLEASE

Hi,

I wanted to clean out all old/test customer and order records from my site before i set it live so i went into the database and emptied tables like customers, orders etc. I took a backup first of course. Anyways, after doing that i got an error when i try to place an order so i restored all those tables back to what they were thinking that would fix it but for some odd reason im still unable to place an order.

When i go into the Admin there is nothing displayed under orders even though when i check the DB there are heaps of orders in the orders table. The only other thing i did which could have affected things is under Store Manager in the admin "Reset ALL Products Ordered" however i didnt think those values in the products table affected the orders at all.

I found similar posts in the forum but no answers to what causes this, is there a table which is altered when placing an order that i dont know about and when i restore the tables i wiped it doesnt add up?

Any help would be greatly appreciated as i need to get this fixed in the next 12 hours!!!

Thanks in advance,
Brad.

29 Apr 2008, 7:26 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Orders not showing in admin after db cleanout - HELP PLEASE

It is unwise to delete order history; hence no option is offered for that other than manual one-by-one deletions, which are the most reliable method.

If you desire to do it in the raw database, you'll need to TRUNCATE the various tables which store order details. A list of database tables grouped by function is found here:
http://www.zen-cart.com/wiki/index.php/Developers_-_Database_Schema#Order_History

29 Apr 2008, 7:27 AM
#3
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: Orders not showing in admin after db cleanout - HELP PLEASE

What method did you use to backup the dbase? Did you do this in PHPMyAdmin, or via some other backup method?

Do you have a full sql file of your original database that you could open in a text editor?

If so, what you could try is reloading your backup into a NEW dbase with a different name, then in your configure.php files, point your webshop to the new dbase.

29 Apr 2008, 7:33 AM
#4
emtecmedia avatar

emtecmedia

Zen Follower

Join Date:
May 2005
Posts:
108
Plugin Contributions:
0

Re: Orders not showing in admin after db cleanout - HELP PLEASE

i backed it up using Navicat so i cant restore to a new db and do the switch, however i could restore over the top of the current db which would mean all todays products which i added will be gone.

considering i restored the tables i altered i dont see why it should be back to normal, these are the tables i wiped and then restored:

address_book
customers
customers_basket
customers_basket_attributes
customers_info
customers_wishlist
orders
orders_giftwrap
orders_invoices
orders_products
orders_products_attributes
orders_status_history
orders_total

since the restore all teh customers section seems to be working fine, just the orders which wont show at all...

any ideas???

Brad.

29 Apr 2008, 7:41 AM
#5
emtecmedia avatar

emtecmedia

Zen Follower

Join Date:
May 2005
Posts:
108
Plugin Contributions:
0

Re: Orders not showing in admin after db cleanout - HELP PLEASE

ok figured it out, i had forgotten to restore the orders_status table.

sorry, thanks for your time!

29 Apr 2008, 7:42 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Orders not showing in admin after db cleanout - HELP PLEASE

If you mistakenly emptied the orders_status table instead of orders_status_history, then I'm not surprised that you're not seeing any orders in the admin orders page ... because it uses that table to cross-link certain pieces of information. The orders_status table does not contain any order data, just the status codes.

edit: I type too slowly :)

29 Apr 2008, 7:58 AM
#7
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: Orders not showing in admin after db cleanout - HELP PLEASE

emtecmedia:

ok figured it out, i had forgotten to restore the orders_status table.

sorry, thanks for your time!

Good stuff, Brad !

I make frequent "txt" copies of the dbase (saved as XXXXXX.sql) which I then use as "backups". I do this by "dumping" the dbase through phpMyAdmin. This allows me to "restore" tables and content at my discretion. As the dbase grows, however, this file gets quite large.

I spent quite a bit of time learning MySQL basics, and this knowledge has helped me. With large dbases, I now split the "dump" into manageable volumes, and find this approach to be very effective when things go pear-shaped!