WP e-Commerce to WooCommerce

There’s a pair of websites that I have looked after for a long time. They belong to a company that sells a few products, and have had quite a few sales over the years. This fall we’re doing some major renovations, and one of the things being changed is the underlying E-Commerce plugin for WordPress; we are changing from WP e-Commerce to WooCommerce. I expected that after installing WooCommerce it would offer to convert my WPeC store into a WooCommerce store. I was wrong. There was an official converter plugin but it was abandoned long ago.

Options to change a site from WP e-Commerce to WooCommerce

It looks like there are three ways to change a site from WP e-Commerce to WooCommerce:

  1. Use a commercial service like Cart2Cart. Cart2Cart looks great, but is made to move a store from one site to another, and I need an in-place conversion. They also charge per-migration, so if I want to migrate my localhost, modify the theme for WooCommerce, then migrate the live site, I’ll have to pay 1.5 times, (they give a 50% discount for re-migrating a site). With two sites my bill would have been around US$450, high enough for me to look at other, more complicated options.
  2. Create or update something like the old WooCommerce migration plugin.
  3. Manual Migration: This would involve a lot of SQL.

Cart2Cart looks ill-suited for my use-case, and expensive. Manual migration looks difficult, highly prone to errors, and not easily repeatable. This leaves creating or updating a migration utility. This migration script by Carl Hughes is bit newer than the WooCommerce one, promises to do more out of the box, and quick read-through doesn’t show anything too mysterious. It was my starting point.

Updating and Testing

It took three times as long as expected to update & test the migration plugin. Here’s what I learned, for anyone else that might be considering the same type of process:

  • This should go without saying, but this migration is destructive. If it fails the database will be in a strange state between WPeC and WooCommerce. Have a backup.
  • Since migrating from WPeC to WooCommerce changes the database, but only the database, (no media files are touched), a backup of the WordPress database is required. A lot of time will be spent reloading from the backup, so put it somewhere easy to get. Mine was on my desktop. Bonus points: a short bash script to reload the DB from the backup will save development time.
  • Make the backup be the exact state that the migration should run from. It is not efficient to disable a plugin in the WP Admin every time the database is reloaded.
  • Some plugins really slow down the migration. The most obvious ones are WP e-Commerce itself, and any Varnish caching plugin. If they are disabled the migration will run faster.
  • Each payment gateway, (plugin for a payment processor, in WPeC terminology), stores transaction data a little differently. I added the ability to port data from Authorize.Net credit card transactions, but separate routines need to be written for other processors.

Updated Migration Plugin

My fork of the migration plugin is up on Github, and a I sent a pull request to the original author so he can include my work if he wants. If you need to migrate from WP e-Commerce to WooCommerce hopefully this can help a bit. Read the readme. Migrating is harder than it should be, but it is possible.

The Melee about “WP e-Commerce to WooCommerce

  1. I’ve tried the abandoned woocommerce converter and your converter. The woocommerce version does converts ONLY the products. That is a big problem but it seems to work pretty well for the products. Your converter works pretty converts the orders as well as products and that is a huge win. None of the pictures come over with the products with is puzzling to me sense the abandoned plugin works so well. Ideally your will soon handle the pictures correctly.
    Suggestions:
    – keep the wpec tables as they were originally so it is easier to make multiple conversions
    – add a switch or button to delete the wpec tables everything checks out ok.

    Thanks much for your efforts on this!

  2. I did end up using your software to make the move. However, in a strange way. I first used the abandoned plugin to move the products. Then I ran your plugin to move the rest. Yours did not have any problem with the products having already been moved so it all worked fine. Very Nice!

    Thank you for the tool,
    Will

  3. @Will That sounds like a good plan. I think the reason that images didn’t move properly for you is that the site that I was migrating – so the software was adapted for – used an ancient method of storing the WP e-Commerce images, so it doesn’t move the more “modern” WPeC galleries.

    It should have at least moved over the main image, (the post thumbnail).

    Thanks for the suggestions. If I update the software more I’ll see what I can do. There is another site that may need conversion eventually.

  4. Hey John,

    Thanks for the response. My WPEC store would have been 10 years old this August. Every time I went to update the software I have to do lots of work to get it working again. It got to the point that I couldn’t really maintain it myself. So glad I am rid of it now.

    Thanks again for the plugin, it was a real game changer for me.
    Will

  5. Hi John,

    Really interested in trying out your wp-ecommerce to woocommerce converter plugin.

    Do you think this is likely to work converting the latest version of wp-ecommerce data into the latest version of woocommerce?

    Also, just wondered if it will transfer the product images on your latest version? and whether the image urls would stay the same?

    Also, will it keep the urls the same, without the need for any 301 redirects?

    I’ve had a look at the woocommerce permalinks, and can see that there is a custom base one, where you can select: /product-pages/%category%/
    to get the urls pretty much the same.

    Would more than likely require some code in htaccess to hide the main category part, so that it doesn’t show the main and sub category together.

    Kind Regards,

    Andy

  6. Hi Andy,

    On the site I created the plugin for we were using shop-page/product-slug for the product permalinks and we were able to keep them the same. I think we also kept the categories the same, but it’s a site with only 2 products main product, (and a several variations on each), and 8 “accessory” products that are used as a way to display the variations, so categories & tags aren’t a big deal.

    If you’re using a recent-ish version of WP e-Commerce then the images should transfer. The plugin works by modifying the post type of each product, so any images that are attached to a product should remain attached. Also, it tries to grab the gallery and turn it into a WooCommerce gallery.

    I haven’t tried it with a recent version of WooCommerce. WP e-Commerce hasn’t changed since this plugin was released so you’re ok there.

    What I would do is make a copy of the site you want to migrate, (maybe on your localhost?), then run the migration and see if it works and comes out as expected. If it works, great! If not then you might be able to tweak the plugin to resolve any problems you’re having.

    At this point I would NOT run the plugin on a live version of the site without testing and verification first. And a good backup.

  7. Hi John,

    Many thanks for taking the time to reply.

    I must say I was very impressed with your fork of the migration plugin.

    I set up a copy of our website on localhost and ran the migration. It works very well!

    It carried across all the products, but for some reason some of the images were missing. Every single product came across, with the correct price, and the “in stock” or “out of stock” attribute applied correctly.

    The variations came across too! Which is brilliant! I did notice that the variations where the pictures were missing didn’t carry across the variation data.

    I had to run the migration on Woocommerce 3.4.7, as it didn’t seem to work on the latest version of WooCommerce.

    Also, I’m running the latest version of WP-Ecommerce.

    I’m now trying to see if I can identify what caused the missing images. Apart from that it’s a brilliant migration plugin!

    One other thing I did notice, was that not all the customer orders would carry across.

    Not sure if you could think of a possible reason for the missing images and some of the missing customer orders?

    Would like to thank you for your time in providing a great fork of the plugin!

    Kind Regards,

    Andy

  8. For images, it may be possible that if you have an image that’s attached to a post or page or product somewhere, but is used in several product galleries, then that image may only stay attached to the original post that it was uploaded to. I don’t remember exactly what happened there, but I know we had a strange arrangement on the site that I migrated where we always uploaded a copy of the image to every product, (so, for example, if we had 3 different T-shirts, and they all came with a free hat, we would upload the same hat image 3 times: once to each T-Shirt page, instead of just including the same hat image in each of the product galleries). This means I didn’t have to test the image migration very much myself. We also never added separate images for variations, (is that even possible in WPeC?), so moving variation images would not have been tested. (After writing this I just re-checked the code and there’s nothing moving the more modern WPeC galleries to WooCommerce, so this is the problem).

    For orders, that’s pretty strange, but a quick look through the code shows me that when moving an order it checks if a WooCommerce order already exists with the order ID of the order that it’s trying to move. Is there the possibility that some WooCommerce orders already exist in the database? You could make it write to a log each time it skips an order, which would help identify if that’s the problem, (look around line 1232).

  9. Hey John,

    Just want to let you know that I found your plugin on Github through Google and it has saved me a bunch of time and I am truly grateful for it. It’s done exactly what I need to do. I’d love to make some sort of contribution to thank you for your efforts in creating this.

    Cheers,
    Jesse

  10. Hi John,

    Many thanks for your reply and time.

    I’ve since made some changes to the php.ini file and increased some of the settings in there, and then ran the migration plugin again.
    This time nearly all the orders migrated across successfully, with only the last 3 months worth which didn’t come across.
    I do have quite a lot of products too, which lead me to look at the settings inside the php.ini file.
    Also, I’m running on PHP7.3, and using an older version of Woocommerce. I’m going to check out the PHP compatibility on the older Woocommerce version, and see if this maybe contribution towards the missing images.
    Sorry, on the variations, what I meant is that on the products that had variations; on the ones where there was no main product image(I can confirm that you are right on the variation images, it’s impossible to have separate images for the variations) the variation data didn’t come across.

    Really appreciate all your help and advise John.

    Kind Regards,

    Andy

  11. Hi John,

    Forgot to say, there weren’t any WooCommerce orders already in the database.

    Thanks again for all your help and support! It’s been really appreciated!

  12. Hi John,

    I’ve run the migration plugin again and all the orders have come across this time, which is amazing!

    Just the missing images for me to sort out now!

    Kind Regards,

    Andy

What do you think?

Your name and E-mail address, and of course a comment, are required. I won't do anything evil with your E-mail address.

If you so desire, you may use these tags in your comment: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Made by John