Not knowing on how you deleted them. The only thing I can suggest is. Find what product ID is displaying. Then use phpmyadmin and look in products_description table for that product ID and also look in products table for the same product ID.
If the product ID was deleted from the products_description table and not from the products table it will not show up in ZC admin. But will still have the product in the system.
• 446F63746F722057686F •
Hi,
import_osc_orders.php and import_osc_products.php work fine for me with no problems but when I run import_osc_customers.php
I receive this error:
Importing Address Book ...
.Duplicate entry '1' for key 1
Any ideas?
Thanks for your help,
Matt
Check your osc database table address_book look at address_book_id field. What you are looking for is a duplicate number in the address_book_id field.
Because this is a auto_increment field it should not have one but who knows?
If you find one the only thing I can say is delete the dupe.
YOU DO HAVE A BACKUP OF OSC DATABASE RIGHT?
Skip
• 446F63746F722057686F •
Hi Skip,
Thanks for the quick reply.
First off, yes I have everything backed up.
The address_book_id field in my osc database does have duplicate numbers (1,1,1,3,1,2,1,2,1,etc...). Is it OK to delete the numbers and just enter '' (like the 3rd field has for `entry_gender`) or should I use the same number as the `customers_id`?
Thanks,
Matt
Matt
record 1 > address_book_id = 1 customers_id =1
record 2 > address_book_id = 2 customers_id =2
The above assumes that customer 1 only has one address in there address book and the same for customer 2.
The address_book_id will = customers_id until a customer has more then one record in there address book. When that happens the address_book_id will change to plus one(1).
So as more customers add extra address to there address book the address_book_id will get farther ahead in #.
But address_book_id can not have a value the same as any other address_book_id record in the whole table.
If that is the case the address book table is corrupt.
• 446F63746F722057686F •
Thanks Skip,
You explained it perfectly, and it worked now!!!
For anyone that might come across this thread and have the same problem with your osCommerce database here are the steps I used to get the transfer to work
(May not be the best way but it worked for me).
1) Export out the osCommerce database thru phpMyAdmin as an sql file.
2) Open the osCommerce database with your preferred text edit program (Im on a mac so I used TextWrangler).
3) Do a find for "INSERT INTO `address_book`" (without the ""'s)
4) Select and Copy the found line and all the address book entries below it (until you get to -----------------).
5) Open Excel and paste, then sort ascending (make sure the `customers_id` numbers run numerically).
6) Now after the first "," (`address_book_id`) change the number to run numerically (in my case I had 1,1,1,3,1 and I changed them to 1,2,3,4,5, etc..).
7) When that's done copy what you did in Excel and paste it back into your sql file.
8) Now do a find for "INSERT INTO `customers`" (without the ""'s)
9) Select and Copy the found line and all the customers entries below it (until you get to -----------------).
10) Open Excel and paste, then sort ascending (make sure the `customers_id` numbers run numerically again)
11) Now after the 6th "," (`customers_default_address_id`) change that to what you changed the `address_book_id` to in the first steps.
(So for an example you look at `customers_id` #10 and you just changed the `address_book_id` to 13 (a few customers have multiple addresses entered) you would now change the `customers_default_address_id` to 13 (You have to do this to get the customers address info to show up under Customers in the admin section of ZenCart))
12) When that's done copy what you did in Excel and paste it back into your sql file.
13) Save the sql file.
14) I now created a new database on my hosts server and imported the edited sql file into it (I didn't want to mess with my original osCommerce database).
15) Change the database info in "import_osc_configure.php" to point to the new database you just created and upload it to your hosts server. Now run "import_osc_customers.php" again as described in the "readme.txt" file in the "oscommerce_data_importer" download.
Hopefully this makes sense and works for anyone that needs it.
Matt
I used the import tool to pull lots of data over to a new Zencart from OSC. What a time-saver! Thanks.
One issue I ran into that I wanted to document here in case anyone is searching for it.
The symptom is that I added a text box option name to a product. Then when I went to the attribute controller page, it wasn't there. It was listed as a name but I couldn't place it anywhere.
After much troubleshooting, I discovered that the old OSC database did not have a products_options_values of zero for "TEXT". I don't know if that is normally missing or if the previous developer customized it out of there. When the importer wrote over my ZC, it wiped out my ability to add text boxes for attributes. So if anyone runs into the same thing, go into phpmyadmin and add a new products_options_values with ID=0, language=1, name=TEXT, and sort=0. A simple solution once you know where to look!
HTH,
Jim Smith