-
-
Notifications
You must be signed in to change notification settings - Fork 161
Description
| Q | A |
|---|---|
| Bug report? | yes |
| Feature request? | no |
| BC Break report? | yes |
| RFC? | yes |
This would be a great issue for discussion btw.
I'm going to publish my notes, which i gathered during the migration. Some steps are because of migration bugs, some of them are just notes which should be noted:
- I'll mark a Note with 💡
- I'll mark a Bug with 🪲
Variants
CoreShop 3 comes with a built-in variant system. There are some new properties in the project class, which are very generic: mainVariant, allowedAttributeGroups and attributes: If your object already comes with properties with the same name, you need to migrate them first!
Preparing
- 💡Make sure all your class definitions have set the
generateTypeDeclarationsflag set to true - Remove methods from Interfaces (Otherwise you'll run into "
..Class C** contains x methods.." ):CoreShop\Component\Customer\Model\CustomerInterface:- (get|set)Company
CoreShop\Component\Customer\Model\CustomerAwareInterface:- (get|set)Customer
CoreShop\Component\Address\Model\DefaultAddressAwareInterface:- (get|set)DefaultAddress
CoreShop\Component\Core\Model\OrderInterface:- (get|set)NeedsRecalcuation
CoreShop\Component\Order\Model\OrderInterface:- (get|set)QuoteState
- (get|set)SaleState
- (get|set)QuoteNumber
CoreShop\Component\Taxation\Model\TaxItemInterface:- (get|set)TaxRate
CoreShop\Component\Core\Model\OrderItemInterface:- (get|set)UnitDefinition
CoreShop\Component\Pimcore\Slug\SluggableInterface:- (get|set)Slug
CoreShop\Component\Variant\Model\ProductVariantAwareInterface:- (get|set)MainVariant
- (get|set)AllowedAttributeGroups
- (get|set)Attributes
CoreShop\Component\Variant\Model\ProductVariantTrait:- getAttributes
- 💡Do core migration migrations
- 💡Set parent to "" in
definition_CoreShopCart.php - 💡Set parent to "" in
definition_CoreShopCartItem.php - 💡Set parent to "" in
definition_CoreShopQuote.php - 💡Set parent to "" in
definition_CoreShopQuoteItem.php - 💡Rebuild classes
Session Config
If you're using Offsite-Payments, make sure your cookie samesite setting is set to lax (#2168):
framework:
session:
cookie_samesite: 'lax'Missing Migration Fields
- 🪲Field
getNeedsRecalculationis missing indefinition_CoreShopOrder.php - 🪲Field
unitdefinitionis missing indefinition_CoreShopOrderItem.php - 🪲Field
taxRateis missing inclasses/fieldcollections/CoreShopTaxItem.php
Migration Issues
Version20200206155318
- ✅ 🪲
Usefixed via e3116c1$user->setKey(Service::getValidKey($customer->getEmail(), 'object'));
Version20200415153638
🪲If you're dealing with thousands of orders, this migration will fail because of memory issues. You need to add an GarbageCollector:
# [...]
$c = 0;
foreach ($batchList as $orderItem) {
$c++;
# [...]
$xy->save();
if ($c % 200 === 0) {
\Pimcore::collectGarbage();
}
}Version20221118072640
🪲Same as in Version20200415153638
Version20200415154821
🪲Same as in Version20200415153638
Cart to Order Migration (Version20200415161210)
This is a heavy migration which I've cleared out. First, we have projects with hundreds of thousands of carts, so this migration would run forever. Second, there are some issues within the migration.
I would suggest moving this version to command.
However, if you want to migrate this version, there are some preparations:
Version Priority
Move Version to the end, otherwise the migration will fail because of missing fields:
-
🪲 rename
Version20200415161210.phptoVersion20220824065815.php -
💡Create messenger table
messenger_messages(at least I had to do this?) -
💡Create
CartandCartItemModel in App\CoreShop\Model (copy from an existing CS 2.2 project)- set parent to
\App\CoreShop\Model\Cartindefinition_CoreShopCart.php - set parent to
\App\CoreShop\Model\CartItemindefinition_CoreShopCartItem.php
- set parent to
Layout Migration
- 💡Before running
Version20220817144952.php, check if your definition has a layout called "numbers" (adjust, if not) - 💡Before running
Version20220503144151.php, check if your definition has a layout called "details"(adjust, if not)
Routes
- 💡🪲Change existing object link generator back to origin, they got changed during migration (product →
@coreshop.object.link_generator.product, category →@coreshop.object.link_generator.category)
Security
- 🪲 After the user migration, all users are disabled. Run
UPDATE objects SET o_published = 1 WHERE o_ClassName = "CoreShopUser"; TRUNCATE TABLE cache_items; to set them to published - 💡Change password algorithms in CoreShopUser if required (based on your current installation)
Payment
- Make sure, your payment gateways are supporting CS3 (re-implement payum payment interface #2164)
Custom Grid Layouts
- Pimcore Bug: "locked" attribute is missing in every item. Hotfix: Change in DataObjectHelperController line 707:
$config['locked'] ?? null - Then open every grid layout and resave them
Templates
- 🪲Template
Customer/settings.html.twig: email field has been removed (Because of it's corresponding FormCustomerType). Currently, it is not possible to change email address. Maybe add another template (e.g.change_email.html.twig) - 🪲 Block Prefix in CarrierChoiceType has changed:
CoreShopFrontend/Form/fields.html.twig:coreshop_checkout_carrier_choice_widgetinstead ofcoreshop_carrier_choice_widget - 💡
coreshop_pathhas been removed, usepathorpimcore_object_path - 💡
Checkout/steps/address.html.twigandCheckout/steps/customer.html.twighave changed significantly!- There are also a lot of new Forms, make sure to adjust your extensions - if available
- 💡You may want to change
item.getTotal()toitem.getSubtotal(), see more about that here: Cart Item Adjustment Calculation #2190
Checkout
- 🪲 Revise (Restore Cart) not implemented (see Reimplement User Cart Revise Cancellation #2166)
Cart Processor
- There is a new Cart Subtotal Calculator. If you're dealing with custom
Adjustmentsper Item, you may need to adjust your processor priority.
Cart Context
🪲 If you're using services with tag coreshop.context.cart: Unable to register coreshop.context.cart Services
AddressFormat
All addressFormat needs to be changed:
UPDATE coreshop_country SET addressFormat = '{{ company }}
{{ salutation }} {{ firstname }} {{ lastname }}
{{ street}} {{ number }}
{{ postcode }} {{ city }}
{{ country.name }}
{{ phoneNumber }}' WHERE addressFormat = '%Text(company);
%Text(salutation); %Text(firstname); %Text(lastname);
%Text(street); %Text(number);
%DataObject(country,{"method" : "getName"}); %Text(phone);'Finalization
- Remove legacy
base*base fields fromCoreShopOrderandCoreShopOrderItemclasses (Check if all your migrations were successful first!) - Add CoreShopCoreBundle to SettingsStore:
INSERT INTO `settings_store` (`id`, `scope`, `data`, `type`)
VALUES
('BUNDLE_INSTALLED__CoreShop\\Bundle\\CoreBundle\\CoreShopCoreBundle', 'pimcore', '1', 'string');