- Place the source DB into data/old.db.
- Ensure your local DB (the one used for development) is up-to-date.
- Add the list of models and tables in dependent order.
- Add your own defaults for columns that are required but have no source data.
- Run the command, fix any problems.
- The db in data/new.db will have the latest schema and workable current data.
This does not need Flask to be used. It could be adapted for general use with SQLAlchemy only.