PDA

View Full Version : Moving from OSCommerce to OScMAX



zippy142
12-29-2011, 02:47 PM
Total newbie to Ubuntu/Oscommerce but I plowed ahead and got a website up about a month ago for my small business. I only have a couple of customers and used Easy Populate to easily load the products. I started looking for some add ins to enhance the site and stumbled upon OSCMAX! Since the store is so new I'd like to just move right to OSCMAX which would save me a lot of time instead of installing all the add ins. Is there a step-by-step guide to removing/overwriting OSCommerce and installing OSCMAX? Can I simply change the name of the Catalog folder so I can go back to it if the install goes bad? Can I delete or rename the database in PHPMyAdmin? Thanks for any help and responses in advance. Please keep it a simple as you can.

llamma
01-11-2012, 08:51 AM
No its not that easy. I've recently performed a migration from OSC to Max.
A few things you will want to consider. What items to you want to move, customer accounts and history or just products?
The databases are similar but not the same so you cannot expect to swap one for the other and keep things working.
If you want only to move products, you could go the Easypopulate route that shouldn't be too hard just complete the install of Max and add easy populate to your existing OSC install do an export from OSC and an import to OSCmax. (honestly I've never used easy populate so I really don't know if it will be easy and straight forward)

I would suggest adding OSCmax in a folder next to your existing shopping cart
yoursite.com/catalog <-existing OSCinstall
yoursite.com/catalog2 <-install max here

The next major undertaking will be photos, OSC has one folder with one image size and every photo in the entire cart be it manufacturer product or category photo is piled in there. Max has 3 folders with 3 sizes, for products so you will want to take your existing photos and do a batch update to edit size, I used fireworks because that is what I use, everyone else in the free world use photoshop as far as I can tell. You can also google for batch image processing there are a few free ones out there that can do batch image resizing as well. You really do need to resize the images and not just upload the same images to each folder or you will be serving out big images as thumbnails. Max allows you to upload one large image and it generates the medium and small from the large one. Also you could just upload all your large product images into images big and use the tools/image manager/regenerate missing function to create medium and thumbs. I did it the hard way I guess havent tried regenerate missing so cannot comment on how that works. You will still need to find your manufacturers and category photos from within the osc images directory and move them to the proper directories.

oscommerce
catalog/images <--blam everything goes in here

OSCmax
catalog/images/images_big <--large product images
catalog/images/products <--medium product images
catalog/images/thumbs <--small product images
catalog/images/manufacturers <--manufacturer logos
catalog/images/categories <--category images

Once you have your OSC max installation the way you like it and are ready to go live with OSCmax
Set permissions to 755 on the files (so you can edit them)
catalog/includes/config.php edit the values for
define('HTTP_COOKIE_PATH', '/catalog2/');
define('HTTPS_COOKIE_PATH', '/catalog2/');
define('DIR_WS_HTTP_CATALOG', '/catalog2/');
define('DIR_WS_HTTPS_CATALOG', '/catalog2/');
and
define('DIR_FS_CATALOG', '/home/YOUR_USER/public_html/catalog2/');

In catalog/admin/includes/config.php edit the values for
define('DIR_FS_DOCUMENT_ROOT', '/home/YOUR_ACCOUNT/public_html/catalog2/');
define('DIR_WS_ADMIN', '/catalog2/admin/');
define('DIR_FS_ADMIN', '/home/YOUR_ACCOUNT/public_html/catalog2/admin/');
define('DIR_WS_CATALOG', '/catalog2/');
define('DIR_FS_CATALOG', '/home/YOUR_ACCOUNT/public_html/catalog2/');

Change all occurrences of "catalog2" in both files to "catalog", save the changes, set their permissions back to 444 (read only)

rename "catalog" to catalogBAK (OSC becomes unavailable) (optionally you can perform the above changes to the files in OSC but then making it catalogBAK so you can again access the old OSC, this is useful for retrieving credit card, paypal and other configuration settings you might need)
rename "catalog2" to "catalog" (OSCmax becomes available)

If you want customer accounts, order history, address books, reviews, specials, countries, taxes, order status, and all the other things that go along with a store the process gets pretty complicated.

Thats what I needed to do so I started by installing OSCmax fresh in a folder next to my store as described above. Then a took a dump of each database, with the 300MB size of my database this needed to be done via Putty an SSH client. If your database is small you can do this via phpMyAdmin instead.

Once I had the dumps locally I imported them to a local wamp server. Wamp is just an easy package to get Apache, PHP Mysql and various tools installed on a windows machine quick and easy
WampServer, the web development platform on Windows - Apache, MySQL, PHP (http://www.wampserver.com/en/)

With the databases up and running we need to do a compare operation between the two databases using a schema compare tool. I searched out MANY tools, toad was high on my list and I've heard good things from others who use it, but it had a bug with SSH so I couldn't get it to connect to the remote server to upload the changes.
Toad World > MYSQL (http://toadworld.com/MYSQL/tabid/762/Default.aspx)

I ended up using SQLyog, MySQL GUI Tools. MySQL Monitor and Manager (http://www.webyog.com/en/)
I was quite impressed its a powerful tool I'm sure real database administrators can really appreciate some of its high end functions, for me I only needed two, Compare and Synchronize. With the trial of the full version (forget the community edition no compare/synchronize) the demo is crippled with only allowing you to update 2 tables at a time, it worked great but you have to do a lot of leg work to get it done, check box 2 tables, next next next, updates process, back back back, uncheck 2 tables, check two new tables, next next next repeat over and over until all tables are done. I'll definitely consider buying this tool in the future. (Hint: I installed the community edition and clicked upgrade to pro and was presented with a $50 coupon)

So the process goes something like this
source=OSCmax database
target=OSCommerce database

Schema compare will match all the tables that have the same name, then produce a script to change the target database, it will also allow you to apply the changes automatically. This will add needed columns, add indexes, etc. Once the process is complete you have two databases with identical structure. but your OSC database will be missing some new tables that max requires.

Then do a synchronize, (I think you will need to set a few options so it doesn't drop tables that don't exist in the source) use your updated oscommerce as the source and the newly installed oscmax database that is out on the web server as the target. This will add all your data into the existing oscmax database. Here are the tables I found necessary to update.

Address_book
Address_format
Categories
categories_description
Customers
Customers_basket
Customers_basket_attributes
Customers_info
Manufacturers
Manufacturers_info
Orders
Orders_premade_comments <-- I already had this installed on OSC you probably don't
Orders_products
Orders_products_attributes
Orders_products_download
Orders-status
Orders-status_history
Orders_total
Products
Products_attributes
Products_attributes_download
Products_description
products_notifications
Products_options
Products_options_values
Products_options_values_to_products_options
products_to_categories
Reviews
Reviews_description
specials
tax_class
tax_rates
zones
zones_to_geo_zones

Once you are done you will find that there is a problem with Orders-status, whatever your status #4 is, OSCmax will start changing orders that a customer makes a comment on to that status (login to user account, find existing order in history, add a comment to it). In max this default status#4 is Customer Comment. So my method was to add a new status that was my existing stauts#4 and update my existing #4 status to "Customer Comment", then update every order in the database that was in status#4 to my newly made status.

I do not recommend uploading the configuration table, this holds all your data for payment modules, shipping modules and the like, since the levels are certainly not the same from one install to the other uploading that table would cause issues. Instead manually install and update all the modules you need in Max and the table will be built correctly.

Other surprises, it is necessary to upload the countries table. One system has them in ascending order and the other in descending order. Without updating this table all my US orders said they were located in some province of Afghanistan or something!

Words of warning, "I'm not that good" so I guarantee there is at least some bit of bad advice in the above. Perhaps others can chime in and pick apart what I have said, I wont take offense go for it! Its been several months since I did the migration and my notes are not all that complete so take it for what its worth. It should get you started or at least help you decide if you would rather pay someone to do it. There are various developers who frequent this site I'm sure someone would do the migration for you for a fee.

pgmarshall
01-11-2012, 12:05 PM
Now that is a helpful post!! :D

As a side note - there is chat about a tool to migrate from osCommerce to osCmax ... some users may even have a SQL version to do it.

We are thinking about having a nice tool to simply point at your existing store which migrates what it can from the osCommerce store - customers, orders, products, images, etc. However, this will not be before v2.6!

Regards.

llamma
01-20-2012, 01:20 PM
Now that is a helpful post!! :D

Thanks! I've been wanting to get that info "down on paper" for some time. If for no other reason so I can reference it later after I forget how to do it! Zippy's post was all the inspiration I needed I guess. I hope someone finds it useful.

Zippy asked to keep it simple as possible... I'm not sure I did that. The reality is depending on your skill level it might just be better to start over and re-enter everything especially if you just installed your store and loosing a couple customers history is not that big a deal.

If we can start a discussion of "best practices" for a migration I think it would be a really useful article to add to the wiki. But hey if a tool is coming that sounds even better!

Its a definite stumbling block, I think most users get into OSC because they are on a budget once you are there, your stuck unless you have a budget for developer help to get you onto max or thoroughly mod OSC to your needs. Or if you are as stubborn as I, you spend hours and hours learning how to do it yourself.