Executing Fixtures
Since the Starter Pack fixtures are appended to the existing Sylius fixtures, you can load them by running:
php bin/console sylius:fixtures:load --no-interaction
Known Issues
Some block attributes reference entity IDs (e.g., product.id, taxon.id).
By default, Sylius fixtures perform a full database purge using Doctrine’s orm_purger listener with the DELETE strategy. While this removes all data, it does not reset autoincrement indexes, potentially causing entity reference mismatches.
Although Doctrine and Sylius allow setting orm_purger to truncate, this approach isn't compatible with MySQL due to foreign key constraints (it results in a cannot truncate a table referenced in a foreign key constraint error).
In contrast, PostgreSQL supports this behavior using the TRUNCATE ... CASCADE option.
💡 Recommended Approach
To ensure stable entity references during fixture loading, we recommend dropping and recreating the database before loading fixtures.
⚠️ Warning: the command below will drop your existing database. Be sure to back it up first!
Drop and Recreate the Database + Load Fixtures
From the root of your project, run:
php bin/console doctrine:database:drop --force && \
php bin/console doctrine:database:create && \
php bin/console doctrine:migrations:migrate --no-interaction && \
php bin/console sylius:fixtures:load --no-interaction