I have a module (v1.0.1) with an InstallSchema to create a table and an InstallData to create a product attribute.

Now I want to update the module (v1.0.2) to convert the InstallSchema to the declarative schema (for table creation) and InstallData to Data Patch (for attribute creation).

My question here is:
How do we perform the upgrades safely for the customers who are already using v1.0.1 and want to upgrade to v1.0.2? so that there are no errors like table/column/attribute already exists

1 Answer 1


you can try things like taking DB backup , and after converting the setup scripts to declarative schema you will eventually run setup:upgrade , by that time you can try this command like = bin/magento setup:upgrade --safe-mode=1 , and if things go wrong you can easily revert by executing this command bin/magento setup:upgrade --data-restore=1

  • Note that I have already converted setup script to db-schema/data-patch. My only concern is what to consider so that the old customer can use this upgrading version without breaking anything.
    – MagePsycho
    Commented Sep 15, 2022 at 16:43
  • The only guess i can think of is to test it out by yourself like creating a new account all in a local development environment, and primarily first check if the data like customer attribute values are already present or not after the changing to declarative schema.If this is not the answer you are looking for , very sorry i was unable to help you , but please do educate me about your solution.Thank you. Commented Sep 15, 2022 at 16:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.