Game dev
Saved & recent

Save migration

Related terms: save version, schema change, backward compatibility, serialization

Updating saved data so a newer version of the game can understand it. A patch might rename an item, split one statistic into two, or add a field that older saves lack. Reading the bytes successfully is only the first step: the restored data must still make sense under the new rules.

A migration transforms the old representation, supplies appropriate defaults and records which updates have been applied. Factorio supports migrations for renamed prototypes and changed research or recipes. Test real older saves as part of regression testing, including links to content that has changed or disappeared.

Source
Factorio: save migrations
Further reading
Unity Serialization: Implementing Migration for a Type
save v1 saved id seed-03 item seedling save v2 saved id seed-03 item sapling water 0 migration renamed item default value same saved identity
The migration preserves the record ID, changes the item name and initializes the new field to zero.

View in the full Game dev collection