Repository navigation
Moving from WooCommerce
Moving a WooCommerce shop to Wren Shop brings across four things: products (with their photos), customers (keeping their passwords), past orders, and the old shop's addresses, so links and search results still work.
Practise on a staging copy first. Make a copy of the WordPress site, export from the copy, and import into a test Wren Shop. Nothing here changes the WordPress site.
You need up to four files:
| File | Where it comes from |
|---|---|
| Products (needed) | WordPress: Products → Export, all columns, all products. |
| Customers | WordPress can't export users with their passwords by itself. Use a users-export plugin that includes user_pass, or the query below. |
| Orders | An order-export plugin, one row per order with its items as line_item_1, line_item_2… (the usual format). |
| Sitemap | The site's product sitemap, for example /wp-sitemap-posts-product-1.xml (or Yoast's product-sitemap.xml). Save it from your browser. |
If you'd rather not add a plugin, this read-only query (in phpMyAdmin or similar, on the staging copy) gives the customers file. Change wp_ if your tables use another prefix, and export the result as CSV.
SELECT u.user_email, u.user_pass, u.user_registered, u.display_name,
MAX(CASE WHEN m.meta_key = 'wp_capabilities' THEN m.meta_value END) AS roles,
MAX(CASE WHEN m.meta_key = 'first_name' THEN m.meta_value END) AS first_name,
MAX(CASE WHEN m.meta_key = 'last_name' THEN m.meta_value END) AS last_name,
MAX(CASE WHEN m.meta_key = 'billing_first_name' THEN m.meta_value END) AS billing_first_name,
MAX(CASE WHEN m.meta_key = 'billing_last_name' THEN m.meta_value END) AS billing_last_name,
MAX(CASE WHEN m.meta_key = 'billing_address_1' THEN m.meta_value END) AS billing_address_1,
MAX(CASE WHEN m.meta_key = 'billing_address_2' THEN m.meta_value END) AS billing_address_2,
MAX(CASE WHEN m.meta_key = 'billing_city' THEN m.meta_value END) AS billing_city,
MAX(CASE WHEN m.meta_key = 'billing_postcode' THEN m.meta_value END) AS billing_postcode,
MAX(CASE WHEN m.meta_key = 'billing_phone' THEN m.meta_value END) AS billing_phone,
MAX(CASE WHEN m.meta_key = 'shipping_first_name' THEN m.meta_value END) AS shipping_first_name,
MAX(CASE WHEN m.meta_key = 'shipping_last_name' THEN m.meta_value END) AS shipping_last_name,
MAX(CASE WHEN m.meta_key = 'shipping_address_1' THEN m.meta_value END) AS shipping_address_1,
MAX(CASE WHEN m.meta_key = 'shipping_address_2' THEN m.meta_value END) AS shipping_address_2,
MAX(CASE WHEN m.meta_key = 'shipping_city' THEN m.meta_value END) AS shipping_city,
MAX(CASE WHEN m.meta_key = 'shipping_postcode' THEN m.meta_value END) AS shipping_postcode
FROM wp_users u LEFT JOIN wp_usermeta m ON m.user_id = u.ID
GROUP BY u.ID;The file holds password hashes and customers' details: keep it safe and delete it when you're done.
The release includes tools/woo-to-wren.php. On any computer with PHP:
php woo-to-wren.php products.csv wren.csv --users=users.csv --orders=orders.csv --sitemap=sitemap.xml
Only the products file is needed; add the others you have. It writes wren.csv (products), wren-customers.csv, wren-orders.csv and a report, wren-report.txt. Read the report: it lists anything that didn't fit, such as:
- products with three or more attributes (Wren Shop has two options), whose second and later attributes are combined;
- grouped and external products, which are left out;
- staff accounts (anyone not a customer or subscriber), which stay in WordPress;
- orders still pending or on hold, which aren't real orders yet;
- product addresses in the sitemap that match no product, and products the sitemap doesn't have.
What it brings across: names, SKUs, prices, sale prices and dates, stock, backorders, weights, categories (as a tree, three levels at most), descriptions (from HTML into plain text), variations as choices (two attributes as two options; a variation for "any" size becomes one per size), photo addresses, tags, and each product's old address.
- Products: Products → Import and export, as any products import. After it's applied, the shop fetches the photos from the old site, so it must still be online. New products stay hidden until their first photo arrives.
- Customers: Customers → Import → Customers. Check, then Bring them across. Accounts that already exist here are left alone.
- Past orders: Customers → Import → Past orders, after the customers so orders find their accounts.
Customers sign in with the password they had in WordPress: the shop checks it the way WordPress does (WordPress 6.8's format and the older ones) and, as they sign in, changes it to Wren Shop's own. Nobody needs a reset email. A customer brought across without a password uses Forgotten your password?. Customers brought across count as having confirmed their email address.
Past orders keep their old numbers (new orders carry on after them), and show in each customer's account and in Orders marked Old shop. They're a record only: they can't be changed or refunded here, never change stock, send emails or count towards discount codes, and are never "to do". They're included in Reports.
Completed, processing, refunded and cancelled orders come across. Finish any orders you're still sending in WooCommerce first. Bringing the same file again adds nothing twice.
Customers → Import → Old addresses shows how many old product addresses came across, and warns about any whose product is hidden or deleted. Download the redirect rules gives a few lines for your site's main .htaccess (the one beside Wren's index.php): paste them straight after RewriteEngine On. Then each old address, such as /product/wishbone-front/, goes to its new page, /shop/p/wishbone-front, and WooCommerce's category addresses (/product-category/…/) to the matching category.
Test a few old addresses in your browser afterwards.