Config File Schema Versioning and Migration: Keeping Updates from Breaking Settings
You update an app and the settings file created by the previous version no longer loads. A key was renamed, a value changed shape. This is a common failure for any software that keeps a config file. This article covers a standard design for it: give the config file a schema version, and convert old formats to the new one step by step (migration). The examples ran on Python 3.12.8, but the idea is independent of any library and works the same for JSON or YAML. Note: “Schema” here means the rules for the file’s structure (which keys exist and what types the values have). The schema number is separate …