How to Migrate a Store From Shopify to WooCommerce Without Losing SEO
WooCommerce Migration Playbook: From Legacy to Scale
This playbook outlines a systematic approach to migrating e-commerce data to WooCommerce. It assumes you are moving from a platform like Shopify, Magento, or a custom PHP/SQL stack.
Phase 1: Data Extraction and Mapping
Do not attempt to import directly into the production database. Set up a staging environment (LocalWP or a staging subdomain) first.
Data Export Strategy
- Products: Export to CSV. Ensure you have columns for SKU, Name, Description, Short Description, Regular Price, Sale Price, Stock Quantity, and Categories.
- Customers: Export to CSV. Include Email, First Name, Last Name, Billing/Shipping addresses.
- Orders: Export to CSV. This is the most complex part. You need Order ID, Date, Status, Customer Email, Line Items (SKUs), and Totals.
Mapping to WooCommerce Schema
WooCommerce requires specific headers. Use the built-in WooCommerce CSV Importer/Exporter as your template.
1. Download a sample CSV from WooCommerce > Products > Import.
2. Map your legacy columns to the WooCommerce headers (e.g., legacy_price -> Regular price).
3. Metadata: If you have custom fields (e.g., "Fabric Type"), map these to Meta: _custom_field_name.
Phase 2: Technical Implementation
Preserving SEO and URL Structure
You must maintain the internal link equity.
1. Export old URLs: Generate a list of all product and category URLs from your legacy site.
2. Generate Redirects: Use a plugin like Redirection or edit your .htaccess file.
3. Bulk Import: Format your CSV as Source URL, Target URL and import into your redirect manager.
Database Operations (WP-CLI)
Use WP-CLI to handle large imports to avoid timeout issues.
# Import products via CLI
wp wc product import products.csv --path=/var/www/html
# Regenerate thumbnails after image import
wp media regenerate --yes
# Clear cache after migration
wp cache flush
Phase 3: Payment and Checkout Setup
Payment Gateways
- Install the official gateway plugin (Stripe/PayPal).
- Test Mode: Ensure the plugin is in "Test Mode" or "Sandbox."
- Webhooks: Configure webhooks in your payment provider’s dashboard to point to
yourdomain.com/?wc-api=wc_stripe.
Checkout Testing Checklist
- [ ] Add product to cart.
- [ ] Apply a coupon code.
- [ ] Complete checkout with a test credit card.
- [ ] Verify order status changes to "Processing" in WooCommerce.
- [ ] Verify email notifications (Admin and Customer).
- [ ] Check tax calculations for different regions.
Phase 4: SEO Verification and Launch
Sitemap and Search Console
- Sitemap: Install Yoast SEO or Rank Math. Generate the XML sitemap.
- GSC: Submit the new sitemap to Google Search Console.
- URL Inspection: Use the "URL Inspection" tool in GSC to verify that a few old URLs correctly return a 301 status code.
- Robots.txt: Ensure your
robots.txtdoes not disallow the/cart/or/my-account/pages, but does disallow/checkout/.
Common Mistakes to Avoid
- Ignoring Image Paths: If you import images via CSV, ensure the images are hosted on a public server. WooCommerce cannot pull images from a password-protected legacy dashboard.
- Duplicate SKUs: If your legacy system allowed duplicate SKUs, the importer will fail or overwrite data. Clean your CSV for unique SKUs before importing.
- Not Testing Emails: Most servers have poor default PHP mail configurations. Use an SMTP plugin (like WP Mail SMTP) to ensure transactional emails actually reach customers.
- Forgetting Order History: Importing orders is technically difficult. If you don't need historical data for accounting, import them as "Customer Notes" or a separate archive rather than live WooCommerce orders to keep the database lean.
- Permalinks: Forget to save your Permalinks settings (Settings > Permalinks) after migration. This often causes 404 errors on product pages.
Pre-Launch Checklist
- [ ] Backups: Full database and file backup taken.
- [ ] SSL: Ensure
httpsis forced for the entire site. - [ ] Performance: Install a caching plugin (WP Rocket or W3 Total Cache).
- [ ] Security: Install a firewall (Wordfence) and disable file editing in
wp-config.php. - [ ] Maintenance Mode: Enable a maintenance page while performing the final database sync.
- [ ] DNS: Update A-records/CNAME only after the final test checkout passes.
Troubleshooting Commands
If the site is slow or imports hang:
# Increase memory limit in wp-config.php
define('WP_MEMORY_LIMIT', '512M');
# Check for database errors
wp db check
# Fix file permissions
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
Need this done for you? Hire me on Freelancehunt: https://freelancehunt.com/freelancer/sspoisk
Комментарии
Отправить комментарий