|
Web Contractors Web Developer Jobs Join Us / Log in Discussion |
Migrating from osCommerce to Zen Cart
I am moving a site from osCommerce to Zen Cart because the HTML on osCommerce is difficult to edit. The tables are burried in PHP classes and the CSS needs refining. I hope that osCommerce v3 sorts this out.
Many Web Developers and Web Designers are opting to use Zen Cart over osCommerce because the HTML is more up to date. Zen Cart is a fork of osCommerce.
This is how I moved the products and categories over. The Zen Cart was a fresh install and I only moved the products and categories. If you are moving a E-Commerce store that has been running for a while then it's going to require more work.
This assumes that your table prefix on osCommerce is different than on Zen Cart. My prefix on osCommerce is osc_ and there was none on Zen Cart. You will need to modilfy these SQL queries accordingly.
I had no products in the Zen Cart Database so I imported the id fields. If you installed the sample data or entered any products then this probably won't work. If you wish to reset any tables and delete the items try using TRUNCATE in MySQL. This worked for version 2.2 of osCommerce and 1.3.7 of Zen Cart.
Here's how:
- Back up the old osCommerce Database and all the files on the Web Server. (I mean it)
- Log into phpMyadmin for the osCommerce Database and export any tables that begin with osc_categories* or osc_products*
- Log into phpMyAdmin on the destination MySQL Server and import all those tables.
- You can check out the differences on any tables by using the EXPLAIN query. (I use command line but you can use phpMyAdmin)
- Run these queries below:
INSERT INTO categories SELECT *, 1 FROM osc_categories;
INSERT INTO categories_description SELECT *, '' FROM osc_categories_description;
INSERT INTO products_attributes (products_attributes_id, products_id, options_id, options_values_id, options_values_price, price_prefix) SELECT * FROM osc_products_attributes;
INSERT INTO products_attributes_download SELECT * FROM osc_products_attributes_download;
INSERT INTO products_description SELECT * FROM osc_products_description;
INSERT INTO products_notifications SELECT * FROM osc_products_notifications;
INSERT INTO products_options (products_options_id, language_id, products_options_name) SELECT * FROM osc_products_options;
INSERT INTO products_options_values SELECT *, 0 FROM osc_products_options_values;
INSERT INTO products_options_values_to_products_options SELECT * FROM products_options_values_to_products_options;
INSERT INTO products_to_categories SELECT * FROM osc_products_to_categories;
INSERT INTO products (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) SELECT * FROM osc_products;
.
You'll need to check your Zen Cart install and move your images to the right place.
Good Luck!
New forum topics
- [MELB] Web Developer | Web Designer | Graphic Designer | Marketing Manager
- Open Source Online Invoicing Software
- Professional Drupal Consulting, Design & Development Services in Australia
- New Year Speacial-Professional Website for 400$ with doamin+Host
- Ruby on Rails Oceana
- WebDev/Design/Research/Consultant - PHP/MySql, Javascript, Joomla, HTML, Flash, AJAX
- Freelance ASP.NET Developer
- System Monitoring with Nagios
- Learning Ruby? What about the RubyMentor Project?
- Need a team
- JAOO Sydney/Brisbane 2009
- Get Your Business a Website for $399 ONLY !!!
- Concrete5: Another CMS!
- Manage The Cloud with Amazon Web Services
- Crystal Reports developer needed


don't forget to drop your old tables!
Make a backup first...
I have started to look at Zencart aswell.
Apparently Zen Cart was reviewed in APC Magazine alongside osCommerce.
Where did you hear about it?
From previous research on shopping cart scripts
Select queries
I have found this page to be very useful, but after having done extensive research, I haven't been able to figure out what 'SELECT *, 1 FROM' is doing in your first line (INSERT INTO categories SELECT *, 1 FROM osc_categories;). The same goes for SELECT *, 0 and SELECT *, '' in some of the other lines. SELECT * FROM obviously means select the contents of all the fields in the referenced tables, but it's the comma and what follows it that has me stumped. Please explain that or at least point me in the right direction.
An extra field
These queries are importing data from one table to another. The target table has an extra column in it in which the value after the comment gets inserted.
Post new comment