Black Friday Deals For Authors Are On Now!

Leanpub Header

Skip to main content

Rescuing Small-Business Legacy Apps with AI

A Safe, Step-by-Step Guide for PHP and Delphi Systems

Rescuing Small-Business Legacy Apps with AI
This book is 100% completeLast updated on 2026-11-25

A safe, small-step method for rescuing the legacy app you inherited, with AI as a helper rather than a gamble.

Minimum price

$9.99

$19.99

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
WEB
APP
About

About

About the Book

Rescuing Small-Business Legacy Apps with AI is for the solo developer, freelancer, small agency, or school IT staff member who has inherited an old PHP or Delphi application and has to keep it running. There is usually no documentation, no test suite, and no version control, and the person who built the system has moved on.


The book is built around a safety net first: full backups, a restore you have actually tested, version control, a separate staging copy, and a written rollback plan. From there it teaches small, reversible steps instead of a big rewrite. You will triage the system, decide whether to rescue, rewrite, replace, or retire it, map how it works, capture its current behavior, close the worst security gaps, upgrade the runtime one step at a time, and move data or functionality gradually behind a stable boundary.


You get working documents, not just principles: a triage checklist, a restore-test checklist, a behavior-capture template, a security quick-win checklist, an upgrade log, a cutover and rollback checklist, a prompt library for legacy work, and a handover template. Three composite walkthroughs show the method applied to a PHP order system, a Delphi billing program, and a small booking script.


The book is honest about outcomes. Some systems should be retired or replaced, and no rescue is guaranteed to succeed, save money, or be risk-free. Security material is defensive and intended for systems you own or are authorized to change, with written permission from the owner. Contracts, data protection, and licensing are discussed only in general terms; this is not legal advice.

Author

About the Author

Kristian Reformis

Kristian Reformis is a dedicated IT educator and tech enthusiast with a mission to bridge the gap between complex technology and modern pedagogy. With years of experience in the classroom, he has seen firsthand the challenges teachers face in an increasingly digital world.

Known as "The Reformist Teacher," Kristian specializes in making advanced IT concepts—from coding to Artificial Intelligence—accessible and actionable for educators of all backgrounds. He believes that technology should not be a burden to teachers, but a powerful catalyst that allows them to focus on what truly matters: inspiring the next generation.

When he isn’t exploring the latest AI tools or developing digital solutions for schools, Kristian enjoys sharing his insights on educational reform and the future of work. The AI-Driven Educator is his latest contribution to empowering teachers worldwide to reclaim their time and transform their classrooms.

Contents

Table of Contents

Preface

  1. Who this book is for
  2. What this book will not do
  3. The rule that holds the book together
  4. Permission comes before curiosity
  5. Privacy: the code is also data
  6. Not legal advice
  7. How to use this book
  8. What you need
  9. What success looks like

1. What Counts as a Legacy App, and Why Small Ones Are Different

  1. What you will learn
  2. Composite scenario
  3. The idea in plain words
  4. Safety net first
  5. Step by step: build a one-page system profile
  6. How to verify the result
  7. What AI typically gets wrong at this step
  8. Common mistakes
  9. Chapter checklist
  10. Summary
  11. Try it on a copy of your own project

2. First Aid: Inventory, Access, and a Safety Net

  1. What you will learn
  2. Composite scenario
  3. The idea in plain words
  4. Safety net first
  5. Step by step
  6. How to verify the result
  7. What AI typically gets wrong at this step
  8. Common mistakes
  9. Chapter checklist
  10. Summary
  11. Try it on a copy of your own project

3. Rescue, Rewrite, or Retire?

  1. What you will learn
  2. Composite scenario
  3. The idea in plain words
  4. Safety net first
  5. Step by step
  6. How to verify the result
  7. What AI typically gets wrong at this step
  8. Common mistakes
  9. Chapter checklist
  10. Summary
  11. Try it on a copy of your own project

4. Mapping the System with AI

  1. What you will learn
  2. Composite scenario
  3. The idea in plain words
  4. Safety net first
  5. Step by step
  6. How to verify the result
  7. What AI typically gets wrong at this step
  8. Common mistakes
  9. Chapter checklist
  10. Summary
  11. Try it on a copy of your own project

5. Capturing Current Behavior

  1. What you will learn
  2. Composite scenario
  3. The idea in plain words
  4. Safety net first
  5. Step by step
  6. How to verify the result
  7. What AI typically gets wrong at this step
  8. Common mistakes
  9. Chapter checklist
  10. Summary
  11. Try it on a copy of your own project

6. Quick Security Wins

  1. What you will learn
  2. Composite scenario
  3. The idea in plain words
  4. Safety net first
  5. Step by step
  6. How to verify the result
  7. What AI typically gets wrong at this step
  8. Common mistakes
  9. Chapter checklist
  10. Summary
  11. Try it on a copy of your own project

7. Upgrading the Runtime One Step at a Time

  1. What you will learn
  2. Composite scenario
  3. The idea in plain words
  4. Safety net first
  5. Step by step
  6. How to verify the result
  7. What AI typically gets wrong at this step
  8. Common mistakes
  9. Chapter checklist
  10. Summary
  11. Try it on a copy of your own project

8. Cleaning Up Without Breaking It

  1. What you will learn
  2. Composite scenario
  3. The idea in plain words
  4. Safety net first
  5. Step by step
  6. How to verify the result
  7. What AI typically gets wrong at this step
  8. Common mistakes
  9. Chapter checklist
  10. Summary
  11. Try it on a copy of your own project

9. The Strangler Path for Small Systems

  1. What you will learn
  2. Composite scenario
  3. The idea in plain words
  4. Safety net first
  5. Step by step
  6. How to verify the result
  7. What AI typically gets wrong at this step
  8. Common mistakes
  9. Chapter checklist
  10. Summary
  11. Try it on a copy of your own project

10. Moving the Data Safely

  1. What you will learn
  2. Composite scenario
  3. The idea in plain words
  4. Safety net first
  5. Step by step
  6. How to verify the result
  7. What AI typically gets wrong at this step
  8. Common mistakes
  9. Chapter checklist
  10. Summary
  11. Try it on a copy of your own project

11. Working with AI on Old Code

  1. What you will learn
  2. Composite scenario
  3. The idea in plain words
  4. Safety net first
  5. Step by step
  6. How to verify the result
  7. What AI typically gets wrong at this step
  8. Common mistakes
  9. Chapter checklist
  10. Summary
  11. Try it on a copy of your own project

12. Talking to the Business Owner

  1. What you will learn
  2. Composite scenario
  3. The idea in plain words
  4. Safety net first
  5. Step by step
  6. How to verify the result
  7. What AI typically gets wrong at this step
  8. Common mistakes
  9. Chapter checklist
  10. Summary
  11. Try it on a copy of your own project

13. Testing, Staging, and Cutover

  1. What you will learn
  2. Composite scenario
  3. The idea in plain words
  4. Safety net first
  5. Step by step
  6. How to verify the result
  7. What AI typically gets wrong at this step
  8. Common mistakes
  9. Chapter checklist
  10. Summary
  11. Try it on a copy of your own project

14. Documentation and Handover

  1. What you will learn
  2. Composite scenario
  3. The idea in plain words
  4. Safety net first
  5. Step by step
  6. How to verify the result
  7. What AI typically gets wrong at this step
  8. Common mistakes
  9. Chapter checklist
  10. Summary
  11. Try it on a copy of your own project

15. Composite Walkthroughs

  1. What you will learn
  2. The idea in plain words
  3. Safety net first
  4. Walkthrough 1: A small order-and-inventory system in PHP
  5. Walkthrough 2: A Delphi desktop billing app with a database
  6. Walkthrough 3: A small organization’s booking script
  7. What the three cases have in common
  8. How to verify your own walkthrough
  9. What AI typically gets wrong across all three
  10. Common mistakes across all three
  11. Chapter checklist
  12. Summary
  13. Try it on a copy of your own project

Appendix A: Triage Checklist

  1. 1. Permission and scope
  2. 2. What the system does
  3. 3. What exists
  4. 4. Ownership and access
  5. 5. Safety net
  6. 6. Risk scores
  7. 7. Decision
  8. Stop conditions

Appendix B: Restore-Test Checklist

  1. Before you start
  2. Restore the code
  3. Restore the data
  4. Prove the application works
  5. Record the result
  6. If it fails

Appendix C: Behavior-Capture Template

  1. Scenario sheet
  2. Preserve-or-fix list
  3. Notes for the next runner

Appendix D: Security Quick-Win Checklist

  1. 1. Exposed secrets
  2. 2. Configuration hygiene
  3. 3. Passwords and sessions
  4. 4. Access control
  5. 5. Uploads
  6. 6. Database accounts
  7. 7. Dependencies
  8. 8. Remaining risk
  9. Stop conditions

Appendix E: Upgrade Log Template

  1. System baseline (before any upgrade)
  2. Target and reason
  3. Rung log
  4. Issues found
  5. Deferred items
  6. Cutover record
  7. Lessons

Appendix F: Cutover and Rollback Checklist

  1. Go/no-go (decide at: ________)
  2. Runbook
  3. Rollback triggers
  4. Rollback steps
  5. After the window
  6. Sign-off

Appendix G: Prompt Library for Legacy Work

  1. Before you start
  2. 1. Session rules block
  3. 2. Explain code for a newcomer
  4. 3. List entry points
  5. 4. Trace one flow
  6. 5. Find jobs and integrations
  7. 6. Draft characterization cases
  8. 7. Constrained refactor
  9. 8. Review a diff
  10. 9. Upgrade impact analysis
  11. 10. Defensive security review
  12. 11. Owner summary
  13. 12. Post-cutover review
  14. Using the answers

Appendix H: Handover Document Template

  1. 1. What this system does
  2. 2. Who uses it
  3. 3. Where it runs
  4. 4. How to get a working copy
  5. 5. Runbook
  6. 6. Accounts and access
  7. 7. Known risks
  8. 8. Decisions already made
  9. 9. Tests and rollback
  10. 10. Maintenance calendar
  11. 11. Contacts
  12. 12. Handover confirmation

Glossary

About the Author

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