Forget Complex Migrations, Use Cleaning Lady Checklist
Migration of legacy code base is a complex process. If we migrate spaghetti, one framework to another or remove dead-code from 120 k-lines project.
It's long, it's hard, it takes an expert to do it... that's bullshit. It should be simple, easy to understand and clear. Like the code we strive to write.
How could any programmer start migration today without any daunting studying?
Simplicity beats Unread Knowledge
I wrote few sum-up posts about migrations in general:
- 8 Steps You Can Make Before Huge Upgrade to Make it Faster, Cheaper and More Stable
- 5 Things I Improve when I Get to new Repository
If you have 6 and 4 minutes to read them, read them. They sum up the experience that you can apply to most PHP projects. But most people don't have 10 minutes to spare.
I don't. I have 30 seconds to solve my problem.
"If you can't explain it simply,
you don't understand it well enough."
Look for a Pattern
When there is a new project to migrate or upgrade, I cooperate with the in-house team to perform the migration together.
After 15-20 such projects, I've noticed a pattern:
- same steps repeat over and over again
- those steps can be split into smaller steps
- these steps can be done me or by the team (usually 50:50)
- they're must have before Rector migration I have to handle
- somebody wrote a great post about Why or How to do these steps, so even a junior can handle them
- I mention these steps in 1st step - project feedback over and over again
I was running towards sunset this Saturday, and a simple idea came to me. It felt great and made sense, so I sprint back to my home to scratch it down and shared it with you.
2 hours later... voilá 🎉
How to use it?
- Fill in your project and activate it
- Check what you've done (or what you don't need)
- The name of project ~= namespace for cache storage, so items are stored per project
- It uses local storage of your browser, so no-one will steal your data
The checklist is my first non-PHP application in years, and I need your feedback to make it better.
Let me know how you use it or what steps you miss. Keep in mind these steps should generally be relevant to most PHP projects.