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.
-
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
,allowedAttributeGroups
andattributes
: If your object already comes with properties with the same name, you need to migrate them first!Preparing
generateTypeDeclarations
flag 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.php
definition_CoreShopCartItem.php
definition_CoreShopQuote.php
definition_CoreShopQuoteItem.php
Session Config
If you're using Offsite-Payments, make sure your cookie samesite setting is set to
lax
(#2168):Missing Migration Fields
getNeedsRecalculation
is missing indefinition_CoreShopOrder.php
unitdefinition
is missing indefinition_CoreShopOrderItem.php
taxRate
is 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:
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.php
toVersion20220824065815.php
💡Create messenger table
messenger_messages
(at least I had to do this?)💡Create
Cart
andCartItem
Model in App\CoreShop\Model (copy from an existing CS 2.2 project)\App\CoreShop\Model\Cart
indefinition_CoreShopCart.php
\App\CoreShop\Model\CartItem
indefinition_CoreShopCartItem.php
Product
mainProductId
has 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'] ?? null
Templates
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_widget
instead ofcoreshop_carrier_choice_widget
coreshop_path
has been removed, usepath
orpimcore_object_path
Checkout/steps/address.html.twig
andCheckout/steps/customer.html.twig
have changed significantly!item.getTotal()
toitem.getSubtotal()
, see more about that here: Cart Item Adjustment Calculation #2190Checkout
Cart Processor
Adjustments
per 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
addressFormat
needs to be changed:Finalization
base*
base fields fromCoreShopOrder
andCoreShopOrderItem
classes (Check if all your migrations were successful first!)Beta Was this translation helpful? Give feedback.
All reactions