Manifest Academy

Home › Curriculum › Deploy, Operate & Upgrade › Migrating custom modules to a new version

Upgrades and migrations · 16 min · 17–20

Migrating custom modules to a new version

Porting code and views, migration scripts (pre, post, end), version bumps, data fixes and testing.

In this lesson

Key points

Real-world example

Renaming a field from x_region to region_id (Many2one) lost all values in the first test upgrade. A pre-migration script copying the old column to a temporary column, and a post-migration script mapping the text values to new region records, preserved 12,000 values and ran identically in production.

Questions and answers

Where do migration scripts live?

migrations/<module version>/ in the module.

Why not use the ORM in pre-scripts?

Models for the new version aren't loaded yet.

Read the full lesson, worked example and quiz