Leanpub Header

Skip to main content

Upgrade Every Day

Guide to overcome any legacy upgrade your agents and dev team struggles with

Upgrade Every Day
This book is 90% completeLast updated on 2026-09-27

Minimum price

$29.00

$29.00

You pay

Author earns

$

Also available for 2 book credits with a Reader Membership

PDF
EPUB
About

About

About the Book

"Upgrading software is like basic hygiene. Do it daily for 10 minutes, and you'll live a long and healthy life.
Skip it for a year or two, and you'll find yourself in the hospital."

Yet, we often perceive software upgrades as something to avoid and postpone as long as possible. We assume it's a massive undertaking that requires stopping everything we're doing to dive deeply into a risky process that could take years to complete. "If it works, don't touch it," right?

But what if we adopted the opposite approach? Instead of postponing and allowing problems to pile up slowly until they become impossible to handle, we face them immediately. We tackle upgrades the moment they're necessary—now.

We upgrade every day. 

I've employed this method for the past eight years, working hands-on with upgrades for clients worldwide. This book distills approaches that are time-tested and proven effective in practice.

You'll learn:

  • Why upgrading is easy but refactoring is not.
  • How to approach a legacy project you've never encountered before.
  • How to prevent your current project from ever becoming a legacy codebase, avoiding issues that quietly but steadily accumulate.
  • How to apply Occam's razor to problems of any size.
  • What the "touch the ceiling" technique is and how to utilize it in desperate situations when upgrading seems impossible.
  • A set of go-to solutions for a wide range of problems—from dealing with a PHP library removed from Packagist and projects lacking type declarations, to major framework upgrades.

Every upgrade contains low-hanging fruit. This book shows you how to identify these opportunities, start small, and build momentum confidently. Soon, upgrading your software will feel as routine and effortless as taking a shower.

Share this book

Author

About the Author

Tomas Votruba

Tomas Votruba is a software architect and open-source advocate who makes complex PHP codebases easier to work with. He’s the creator of Rector, a tool that helps thousands of developers upgrade their legacy code automatically.

Tomas writes with the same clarity and precision he brings to code: sharp, no fluff, always actionable. When he’s not coding, you’ll find him pruning trees, exploring train timetables, or benchmarking CPUs like Threadripper for real-world dev workflows.

He believes the best solutions are boring, fast, and easy to maintain.

His writing speaks to devs who value craft, clarity, and getting things done.

Contents

Table of Contents

Feedback

  1. What’s your struggle?
  2. Introduction

Welcome fellow upgrade master!

  1. Why am I writing this book?
  2. Who is this book for?
  3. What can you expect?
  4. What not to expect?
  5. What if you don’t use PHP?
  6. What if your project has the latest and greatest dependencies?

Who am I?

  1. Getting closer
  2. Finding the trauma
  3. Japanese Culture

Why “Upgrade Every day”

  1. My first (and last) rewrite
  2. What already works in other life areas
  3. Compound Effect
  4. Change is the only constant

Compound Experience

  1. Compound Experience over Single Shot
  2. My First Upgrade: A Cautionary Tale
  3. Mythbusters

Refactor to Microservices

  1. Turning the Tide

Controller-by-Controller Framework Flip

  1. What is a Better Way?

Upgrade is Expensive

  1. Keeping Codebase Out-of-Date is Expensive
  2. Upgrade as an Ordinary Habit

Upgrade Takes Years to Finish

  1. Parkinson’s Law

Only the In-House Team Can Handle the Upgrade

You Can’t Upgrade What You Don’t Understand

Upgrade is One Huge Pull Request

  1. The Bigger the Changes, the More Risk
  2. What is a Better Way?

If it Works, Don’t Touch It

Once We Finish an Upgrade, We Start the Next Upgrade Again

We Lose the Knowledge Base if We Outsource the Upgrade

Our Team Must Have PHP Experts to Make the Upgrade Happen

We Can’t Stop Feature Development for a Year

Upgrade has to happen in one go

  1. Prepare
  2. Why is preparation so important?
  3. Work for a client
  4. Pick your project to upgrade

Before we start planning

  1. 1. Start with “why”
  2. 2. Validate motivation
  3. 3. Find client expectations and adjust them to reality
  4. 4. Address their fears
  5. 5. All-on-board or none

Why outsource the upgrade

  1. Thinking Features vs. Thinking Upgrades

Refactoring is not Upgrade

  1. What we do when we refactor?
  2. What we do when we upgrade?

Under a Year…

  1. How to split too big upgrades?
  2. What if it takes… 3 years or more?
  3. Timebox to activate Occam’s razor

Build Shared Vision

  1. How does the project look like after the upgrade?

Two Types of Upgrade

Separate Code and Infrastructure upgrade

  1. How far should we jump the PHP versions?

Smallest step Possible

Less is More

  1. Reduce, reduce, reduce
  2. New tool/package → + maintenance cost

Climbing Huge Mountain

  1. Make Safe Spots
  2. Staying in the Present Moment - One Move at a Time
  3. Take a Break
  4. The Mountain Climber Way

Planning the Upgrade

  1. Low Hanging Fruit First
  2. Rule of Smallest Gap Jump
  3. Build on Strong Foundations only
  4. Keep having fun

How many hours a week?

  1. Too fast, too furious

Think Big

  1. Analyse and Plan

Why…?

  1. It Protects you
  2. It Protects the Client
  3. “I already know the codebase, no need for looking into it”

More than Meets the Eye

  1. Known problems
  2. Unknown forces

Friction Patterns

Difficulty Factor

  1. From Pride to Beginners’ Mind
  2. Learned Helplessness

Focus Groups

  1. 1. General
  2. 2. Autoload
  3. 3. Testing
  4. 4. Static Analysis
  5. 5. Continuous Integration
  6. 6. Framework-related
  7. 7. Database-related

Building Battle Plan

  1. Why we need a plan?
  2. Real-project Intro Analysis
  3. Multi pronged Attack
  4. Execute

Before we Execute

CI is the King

  1. More than meets the CI? AI

Action: Setup CI Safetynet

  1. Trigger in CI
  2. 2. Know your PHP version
  3. 3. Add composer validate

Deeper Composer Analysis

Spot Deprecations Early

PHPStan Without Levels first

Rector without Rules First

Symfony Service Types before FQNs

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub