Replies: 9 comments
-
|
Wow, thanks a bunch for writing all these steps down and sharing them @solverat! Will be helpful for our upcoming migrations. |
Beta Was this translation helpful? Give feedback.
-
|
Am I missing an obvious migration step when I get the following error?
I executed every single step you mentioned in "Preparing" |
Beta Was this translation helpful? Give feedback.
-
|
did you run |
Beta Was this translation helpful? Give feedback.
-
|
Yes, I ran that command as the last step ("Rebuild classes"). |
Beta Was this translation helpful? Give feedback.
-
|
@seybsen I ran into the same issue (I had to remove all the interface definitions => they are not available before migrations have been dispatched). I updated my notes, see |
Beta Was this translation helpful? Give feedback.
-
|
If you're facing further memory issues, you need to modify the migrations CoreShop does not a very great job when it comes to precheck objects before migrating. Also, all statements will be submitted transactional, so if your migration files due memory issues, it will restart from scratch. By adding this to the migration (and also adjust the foreach() by checking if a migrated value is already given), you could execute the migration multiple times without restarting from beginning. public function isTransactional(): bool
{
return false;
} |
Beta Was this translation helpful? Give feedback.
-
|
Please, is it possible to do the interface customisation outside the vendor folders ? what is the right way to do the customisation. Because if I make the customizations directly in Vendor then after a Composer update or Install the customizations will be lost. |
Beta Was this translation helpful? Give feedback.
-
|
@claudesimo1990 you cannot change interfaces, you can extend them. thats the point of interfaces, it is a contract that has to be meet in order to work. |
Beta Was this translation helpful? Give feedback.
-
|
@solverat I converted it to a discussion and pinned it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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:
Variants
CoreShop 3 comes with a built-in variant system. There are some new properties in the project class, which are very generic:
mainVariant,allowedAttributeGroupsandattributes: If your object already comes with properties with the same name, you need to migrate them first!Preparing
generateTypeDeclarationsflag set to true..Class C** contains x methods.." ):CoreShop\Component\Customer\Model\CustomerInterface:CoreShop\Component\Customer\Model\CustomerAwareInterface:CoreShop\Component\Address\Model\DefaultAddressAwareInterface:CoreShop\Component\Core\Model\OrderInterface:CoreShop\Component\Order\Model\OrderInterface:CoreShop\Component\Taxation\Model\TaxItemInterface:CoreShop\Component\Core\Model\OrderItemInterface:CoreShop\Component\Pimcore\Slug\SluggableInterface:CoreShop\Component\Variant\Model\ProductVariantAwareInterface:CoreShop\Component\Variant\Model\ProductVariantTrait:definition_CoreShopCart.phpdefinition_CoreShopCartItem.phpdefinition_CoreShopQuote.phpdefinition_CoreShopQuoteItem.phpSession Config
If you're using Offsite-Payments, make sure your cookie samesite setting is set to
lax(#2168):Missing Migration Fields
getNeedsRecalculationis missing indefinition_CoreShopOrder.phpunitdefinitionis missing indefinition_CoreShopOrderItem.phptaxRateis missing inclasses/fieldcollections/CoreShopTaxItem.phpMigration 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:
Version20221118072640
🪲Same as in
Version20200415153638Version20200415154821
🪲Same as in
Version20200415153638Cart 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)\App\CoreShop\Model\Cartindefinition_CoreShopCart.php\App\CoreShop\Model\CartItemindefinition_CoreShopCartItem.phpProduct
mainProductIdhas been removed without any notes, see MainObjectId Setter #2375Layout Migration
Version20220817144952.php, check if your definition has a layout called "numbers" (adjust, if not)Version20220503144151.php, check if your definition has a layout called "details"(adjust, if not)Routes
@coreshop.object.link_generator.product, category →@coreshop.object.link_generator.category)Security
UPDATE objects SET o_published = 1 WHERE o_ClassName = "CoreShopUser"; TRUNCATE TABLE cache_items; to set them to publishedPayment
Custom Grid Layouts
$config['locked'] ?? nullTemplates
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)CoreShopFrontend/Form/fields.html.twig:coreshop_checkout_carrier_choice_widgetinstead ofcoreshop_carrier_choice_widgetcoreshop_pathhas been removed, usepathorpimcore_object_pathCheckout/steps/address.html.twigandCheckout/steps/customer.html.twighave changed significantly!item.getTotal()toitem.getSubtotal(), see more about that here: Cart Item Adjustment Calculation #2190Checkout
Cart Processor
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 ServicesAddressFormat
All
addressFormatneeds to be changed:Finalization
base*base fields fromCoreShopOrderandCoreShopOrderItemclasses (Check if all your migrations were successful first!)Beta Was this translation helpful? Give feedback.
All reactions