We have a large monolithic Java service that has almost 10 years of changesets made by different dev agencies and contractors using different styles of changesets (XML, raw SQL, YML).
To make matters worse, there was no original baseline made by the contractors. So if you want to run locally, you have to take a mysqldump of the DB and then restore it to your local mysql instance,
We want to baseline the DB, however we are not sure how that will play out when it gets deployed to existing testing, staging and production environments.
I have tried googling what this process should be like, however I am not sure. So I have tried to come up with my own solution, please advise
- Get fresh MySQL dump from production / test
- Redact any sensitive information
- Restore DB locally on a fresh instance
- Run liquibase locally to generate the new changelog
- Copy the liquibase CHANGELOG table values
- Freeze any DB changesets for a week
- Delete old changesets from codebase
- Commit new changeset
- Login to test DB, copy new CHANGELOG table values into test schema
- Deploy new version of app with new changelog
x. Repeat for staging
x. Repeat for production
Will this solution work?
I am worried that it will try to apply the changelog to an existing schema on test, staging, production?
Any pointers welcomed!