Hi Henry! Welcome to the MongoDB Community Forums, and thank you for your question. To help us better assist you, can you please share what Driver/ODM/ORM you are using to access MongoDB from Python?
By ‘migration’ I assume here that you mean a tool like alembic (https://alembic.sqlalchemy.org/en/latest/)? As far as we know, no such tool exists for MongoDB’s Python ODMs though people have tried to roll their own as you are planning (e.g. https://bitbucket.org/letsignitcloud/flask-mongoengine-migrations/src/master/).
In general, migrations aren’t something that have much importance in the MongoDB ecosystem because of the inherently schema-free nature of the database. The use of migrations implies that your app is written in a way that assumes a rigid schema which means it cannot take advantage of MongoDB’s flexible data model going forward. Instead of a migration, you might want to consider using the schema versioning in your data-model - https://www.mongodb.com/blog/post/building-with-patterns-the-schema-versioning-pattern. When using this kind of a pattern, your application can lazily migrate documents i.e. when a document with an outdated schema version is retrieved, it can be passed through ‘migration code’ that migrates it to the newest schema version before carrying on with applying the application logic.