Skip to content

Existing website

Fetch the products and collections of an existing shop into YAML under .castor/import/var/{project-slug}/, then turn them into Sylius fixtures.

Terminal window
castor sylius:import:existing:fetch https://shop.example.com --project=example
OptionDescription
urlURL of the website (normalized to its base URL)
--projectProject slug (asked, or derived from the name, when omitted)
--nameShop name
--descriptionShop description

The command discovers the sitemap (from robots.txt, with dedicated handling for Shopify and Magento), picks the product and collection pages, and uses the AI configured in the prerequisites to extract the collections. The project is configured for an existing website import, so later commands reuse its URL.

You can also prepare the YAML yourself, without fetching a website.

Terminal window
castor sylius:import:fixtures:generate --project=example --limit=100
castor sylius:import:fixtures:load --project=example

See Fixtures for the options of these commands.

To load the fixtures on a remote server without fetching the website from it, copy the import data of a project over SSH with rsync:

Terminal window
castor sylius:import:var:push --project=example --dry-run # show what would be copied
castor sylius:import:var:push --project=example # copy it
castor sylius:import:var:push --project=example --delete # also delete remote files missing locally

Configure the server in .castor/.env.local:

VariableDefaultDescription
IMPORT_VAR_PUSH_SSH_HOST—SSH host (required)
IMPORT_VAR_PUSH_REMOTE_DIR—Root of the remote project (required)
IMPORT_VAR_PUSH_SSH_USERdebianSSH user
IMPORT_VAR_PUSH_SSH_PORT22SSH port
IMPORT_VAR_PUSH_IDENTITY_FILESSH default keyPrivate key (~/ is expanded)