I'm getting ready to build a new version of a module of mine. The new version can have an upgrade path from the current version to the new version that will be released, but as you know, new major verions come with database restructuring, entity refactoring, and what not.

Is there a standard practice in the way the upgrade path is provided? For instance, should I build code in the install hook of the new version, and update hook, or some stand alone script?

Suggestions welcomed.

1 Answer 1


Add the install information required for the new module version in the hook_install and hook_schema.

Users upgrading presumably won't be re-installing the module, so you'll need to use hook_update_N for those users. Check if the upgrade path is required for that installation and proceed with the update as needed.

Your Answer

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

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