The problem
Delphi apps tend to age well until they don't. The code still compiles, the users still rely on it, and the original developer may have moved on. The trouble shows up in small ways first: a new Windows version breaks a printer dialog, a database client library stops receiving updates, or the only person who understands the payroll calculation is close to retirement.
The instinct is to rewrite the whole thing in a newer framework. That is the most expensive option and the one most likely to fail. A desktop app that has run for fifteen years carries years of business rules that nobody wrote down. A rewrite team discovers those rules one bug report at a time, and the old app keeps changing while the new one is being built.
Delphi itself is not dead. Modern Delphi versions compile to Windows, macOS, Linux, iOS and Android from shared source, and the VCL and FireMonkey frameworks still work. The real problem is usually a mix of old dependencies, missing tests, a tangled data layer and no clear plan for which parts to keep.
A safer path is to modernize in slices. You keep the app running, fix the riskiest pieces first, and add tests around the behavior you cannot afford to lose. Each slice ships to users and each slice can be rolled back.
What a good solution looks like
A good plan separates the app into layers you can change independently. The user interface, the business logic, the data access and the external integrations all move at different speeds. If the business logic sits inside button click handlers, you cannot test it or move it. Pulling that logic into plain units with no form dependencies is the first real step and it costs nothing in user-visible change.
The target state is not one thing. Some modules may stay in Delphi for years because they work and nobody needs to touch them. Others get replaced by a web front end, a service, or a bought product. A good solution names each module and picks rehost, refactor, replace or retire for it. Mixed outcomes are normal and healthy.
You also need a build and release pipeline that can produce a signed installer and roll it out to a small group before everyone gets it. Delphi projects can be built from the command line with msbuild and the .dproj file, which means a build server can compile, run tests and package the installer without a developer's machine.
Finally, a good solution treats the database as part of the app. Schema changes need versioned migration scripts, not manual edits in a database tool. If the app talks to a database that is past end of support, that date drives the sequence, not the UI work.
How to build it
Start with an inventory. List every executable, DLL, third party component, database and external interface. For each one, record who owns it, when it was last changed and what breaks if it stops working. Open the project in the current Delphi version and let the compiler tell you what fails. Fix only the errors that block the build, not the warnings.
Next, recover the business rules. Read the code where the money and the deadlines are calculated. Sit with the people who use the app and watch them work. Write down the rules as test cases, then write DUnit or DUnitX tests that exercise the existing code. This is the single highest value activity. Once the rules have tests, you can refactor or replace the code behind them with confidence.
Then take the riskiest dependency first. If it is a database client, move to a current driver and test against a copy of production data. If it is a reporting component, replace it behind an interface so the rest of the app does not care. Do one dependency per release so a failure has a single cause.
Split the monolith along form boundaries. Move business logic out of forms into units that take plain data in and return plain data out. Introduce interfaces for data access so you can swap the implementation later. Keep the forms thin. This work is invisible to users, which makes it safe to ship.
After the logic is separated, you can choose per module. A module that is mostly data entry might become a web page calling the same logic through a small API. A module that needs local hardware or offline operation stays desktop. A module that duplicates a bought product gets retired. Sequence the releases so each one has a rollback: keep the previous installer and a tested downgrade path for the database.
If you need a structured starting point, the Legacy modernization sprint from Cloudverg runs for three weeks at $8,500/month and produces an inventory, recovered business rules, a ranked risk list and a step by step migration sequence with rollback points. It is one option among several, and a capable internal team can do the same work.
Risks and how to manage them
The biggest risk is losing knowledge. If one person holds the payroll rules in their head, that is an outage waiting to happen. Pair them with someone else on the rule recovery work and record what they say in tests and short notes. Do this before any rewrite starts.
The second risk is the database. Moving a schema while users are entering data can corrupt records. Use a staging copy, run migration scripts twice to prove they are repeatable, and keep a backup you have actually restored at least once. Watch for triggers, stored procedures and views that the app depends on but nobody documented.
The third risk is third party components. Some libraries are abandoned or licensed per developer. Check the license before you ship, and check whether the vendor supports the Delphi version you are moving to. If a component has no path forward, wrap it behind an interface now so you can replace it later without touching every form.
The fourth risk is scope creep. A modernization project attracts every feature request the business has postponed for a decade. Keep a separate list for new features and refuse to mix them into a release whose job is to reduce risk. Each release should have one goal and a clear rollback.
How to measure success
Measure the things that hurt before you started. Track crash reports per release, the time it takes to build and ship a fix, and the number of manual steps in a deployment. If a release used to take a week of one person's evenings and now takes an afternoon on a build server, that is progress you can show.
Track test coverage on the business logic, not the forms. The number that matters is how many of the money and deadline rules have automated tests. A rule with a test can be changed safely. A rule without one is a guess.
Watch the dependency list. Count how many components and libraries are past end of support. That number should fall with each release. Also track how many modules have a named owner and a documented path forward.
Finally, ask the users. A short survey after each release about stability and speed tells you whether the work is landing. Keep it to a few questions and compare answers over time. The goal is not a perfect score. It is a trend that moves in the right direction while the app keeps running.
Frequently asked questions
Do I have to rewrite my Delphi app from scratch?
Almost never. Most Delphi apps can be modernized in slices, keeping the working parts and replacing the risky dependencies and tangled logic one piece at a time. A full rewrite throws away years of business rules that are hard to recover and is the most failure prone option.
Can a modern Delphi version still compile my old project?
Often yes, with fixes. Open the project in the current Delphi version and let the compiler list the errors. Unicode string changes, removed library units and third party components are the usual blockers. Fix only what stops the build first, then deal with warnings later.
How do I get started if nobody understands the code anymore?
Inventory the executables, databases and components, then recover business rules by reading the money and deadline calculations and watching users work. Write those rules as automated tests before changing anything. That gives you a safety net for every later step.