wwfc_barmy_army Posted January 17, 2005 Posted January 17, 2005 Hi. I have had to change hosts recently due to problems but i wanted to keep all the products that i added, so i backed up the database. I am now with my new host and i am trying to restore the database. So i start by getting rid of the thigns i don't want to restore to the database. So i'm left with categories, products and a few other products_* (if i remember right). Well the categories get added no problem, but then when it comes to the first product (and i have also tried deleteing the first product from the backup and it didn't work) it says this: any ideas why? Thanks. Pete.
Guest Posted January 17, 2005 Posted January 17, 2005 Did you use any contributions that involves modifying database structure?
wwfc_barmy_army Posted January 17, 2005 Author Posted January 17, 2005 Did you use any contributions that involves modifying database structure? <{POST_SNAPBACK}> Individual Shipping and the Paypal IPN. Both have been reinstalled apart from that the paypal IPN is the oscommerce version this time, but that shouldn't effect the product table right? Thanks, Peter.
Guest Posted January 18, 2005 Posted January 18, 2005 Let me guess, you used osCommerce's built-in backup feature from Admin and not phpMyAdmin. Or am I wrong?
boxtel Posted January 18, 2005 Posted January 18, 2005 Let me guess, you used osCommerce's built-in backup feature from Admin and not phpMyAdmin. Or am I wrong? <{POST_SNAPBACK}> builtin works fine, it goes wrong when you edit the backup file yourself and delete more stuff than required/desired Treasurer MFC
Guest Posted January 18, 2005 Posted January 18, 2005 you are better off to restore the whole database then remove from within oscommerce.
Guest Posted January 18, 2005 Posted January 18, 2005 Here are the 13 columns in products table from a new osCommerce installation: products_id products_quantity products_model products_image products_price products_date_added products_last_modified products_date_available products_weight products_status products_tax_class_id manufacturers_id products_ordered Which were created from this code section: DROP TABLE IF EXISTS products; CREATE TABLE products ( ?products_id int NOT NULL auto_increment, ?products_quantity int(4) NOT NULL, ?products_model varchar(12), ?products_image varchar(64), ?products_price decimal(15,4) NOT NULL, ?products_date_added datetime NOT NULL, ?products_last_modified datetime, ?products_date_available datetime, ?products_weight decimal(5,2) NOT NULL, ?products_status tinyint(1) NOT NULL, ?products_tax_class_id int NOT NULL, ?manufacturers_id int NULL, ?products_ordered int NOT NULL default '0', ?PRIMARY KEY (products_id), ?KEY idx_products_date_added (products_date_added) ); And here are the 14 values you are trying to insert in your products table: products_id = 1 products_quantity = 100 products_model = '1000P' products_image = 'trust1000speaker.gif' products_price = 24.9900 products_date_added = '2004-12-09 11:33:34' products_last_modified = '2004-12-12 07:01:22' products_date_available = NULL products_weight = 2500.00 products_status = 1 products_tax_class_id = 0 manufacturers_id = 10 products_ordered = -1 (a bit strange) XXXXXXX = 7.4900 (this is the missing column) Some modifications you've made (possibly a contribution) has created the 14th column in your database. And for some reasons, when you made a backup of your database and installed it in your new host. The backup file did not create this new column in the table structure. What method of backup did you use? What does CREATE TABLE products of the backup file look like?
Guest Posted January 18, 2005 Posted January 18, 2005 At this point, you might solve the problem if you use phpMyAdmin to export the products table from the old host to the new one.
wwfc_barmy_army Posted January 18, 2005 Author Posted January 18, 2005 After a few 'Hmmmms' and 'Arrrrrrrs': Thanks for all your help. 'Alpha Ray''s post helped me see what was going wrong, becuase you can have additiontional shipping on the individual shipping contribution it adds an extra table, deleting this table allowed me to restore, and a little tweak here and there and: All done. :thumbsup: Thanks again! Pete.
Guest Posted January 18, 2005 Posted January 18, 2005 After a few 'Hmmmms' and 'Arrrrrrrs': Thanks for all your help. 'Alpha Ray''s post helped me see what was going wrong, becuase you can have additiontional shipping on the individual shipping contribution it adds an extra table, deleting this table allowed me to restore, and a little tweak here and there and: All done. :thumbsup: Thanks again! Pete. <{POST_SNAPBACK}> Anytime, Pete. :thumbsup:
Recommended Posts
Archived
This topic is now archived and is closed to further replies.