tanjil / woo-laravel-migrator
Import and synchronize WooCommerce stores into Laravel applications through the WooCommerce REST API.
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.8
- illuminate/bus: ^11.0 || ^12.0 || ^13.0
- illuminate/console: ^11.0 || ^12.0 || ^13.0
- illuminate/database: ^11.0 || ^12.0 || ^13.0
- illuminate/http: ^11.0 || ^12.0 || ^13.0
- illuminate/queue: ^11.0 || ^12.0 || ^13.0
- illuminate/support: ^11.0 || ^12.0 || ^13.0
Requires (Dev)
- orchestra/testbench: ^9.0 || ^10.0 || ^11.0
- phpunit/phpunit: ^10.5 || ^11.0 || ^12.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Import and synchronize a WooCommerce store into a Laravel application through the WooCommerce REST API — no WordPress code inside Laravel, no direct database access to the shop.
Features
- Full catalog import: products, variations, taxonomy, attributes, images
- Customer and order import with line items, addresses, shipping/tax/fee lines
- Coupons, refunds, reviews, order notes, downloadable files
- Resumable, idempotent, queued imports with checkpointing
- Safe image downloads (SSRF guard, MIME validation, deduplication)
- Local image storage — images work even when WordPress is offline
- Hybrid schema: structured columns +
meta_dataJSON + optionalraw_payload - Custom table prefix (
wc_by default) - Extension adapter system for WooCommerce plugins
Requirements
- PHP 8.2+
- Laravel 11, 12, or 13
- WooCommerce REST API (
wc/v3)
Quick start
composer require tanjil/woo-laravel-migrator
php artisan woo:install
php artisan migrate
php artisan woo:test
php artisan queue:work --queue=woo-imports # for queued imports
php artisan woo:import
For small stores or quick tests:
php artisan woo:import --sync
Documentation
Full usage guide → docs/USAGE.md
Covers installation, configuration, Docker, importing, syncing, images, using data in your app, commands, and troubleshooting.
Common commands
php artisan woo:install # interactive setup php artisan woo:doctor # diagnostics php artisan woo:test # test API connection php artisan woo:import # full import (queued) php artisan woo:import --sync # run in-process php artisan woo:import --fresh --force php artisan woo:sync # incremental sync php artisan woo:status # import progress php artisan woo:connection:reset --force
Environment variables
WOO_MIGRATOR_URL=https://shop.example.com WOO_MIGRATOR_CONSUMER_KEY=ck_xxxx WOO_MIGRATOR_CONSUMER_SECRET=cs_xxxx WOO_MIGRATOR_TABLE_PREFIX=wc_ WOO_MIGRATOR_QUEUE=woo-imports WOO_MIGRATOR_DISK=public APP_URL=http://localhost:8000 # must match how you access the app
Images
Product images are downloaded to Laravel storage. After download, wc_product_images.src_url contains the local storage URL, not the WordPress URL.
php artisan storage:link
Set APP_URL correctly (including port) so image URLs resolve.
Docker
When Laravel runs in Docker, WOO_MIGRATOR_URL must be reachable from inside the container. See docs/USAGE.md#docker.
Development
composer install vendor/bin/phpunit
A demo WooCommerce store is available under dev/demo-store/.
License
MIT — see LICENSE.