Legacy import
packages/core/src/Modules/LegacyImport: brings a shop's data over from the previous version's MySQL database (syn_ tables).
Contracts\LegacySourcegives the old database's connection:Import\LegacyDatabase(MySQL fromLegacyImportSettings, the session set to read-only transactions) in a shop, an in-memory SQLite copy in tests.Import\ImportStep(taglegacy-import-step):key(),after()(steps that must run first) andrun($legacy, IdMap, StepReport, $dryRun).Import\Importerorders the steps, runs each in a transaction (a dry run is rolled back) and records alegacy_import_runsrow with its counts and up to 200 records left behind.Import\IdMap(legacy_import_map): old id → new id by kind (category,brand,product,product_variant,variant), so a second run updates instead of duplicating.- Writes go through the owning modules' contracts:
Catalog\Contracts\CatalogImport,Inventory\Contracts\StockCounts,Storefront\Contracts\RedirectBook,Stores\Contracts\Locations. - Steps:
categories,brands,products(after both),redirects(after products),customers,orders(after customers and products). Customers go throughCustomers\Contracts\CustomerImport, orders throughOrders\Contracts\OrderImport(history: no events, stock moves or invoices;orders.source = legacy). - Old passwords are unsalted MD5: stored as
bcrypt(md5)withcustomers.password_legacy = 'md5';Customers\Accounts\Passwords::check()verifies that way and rehashes at the first sign-in (web and API); a reset or change clears the marker. imagesreads only files inside the configured folder (realpath,basename), the largest copy first, throughCatalogImport::image()(content-checked images, copied); a dry run never copies.pageswrites drafts throughContent\Contracts\PageImport(HTML to Markdown, scripts dropped) and 301s throughRedirectBook::toPage().- An account found only by e-mail is merged into only when its owner confirmed the address (
ImportConflictotherwise, left behind in the run). Import\AddressMatchermaps the old courier county and locality ids to the address register by name (no diacritics, no case); order addresses that do not match keep the old names with id 0. Old text throughImport\LegacyText(names decoded, HTML to plain text, lei to bani, slugs kept when valid).
Tests: tests/Feature/LegacyImport/CatalogImportTest.php, CustomersOrdersImportTest.php, ImagesPagesImportTest.php.