Start with one page on how to keep the system running: where it runs, how to get in, how to tell whether it is working, and how to restart and restore it. Then record what it connects to, what it does for the business, and how a change gets released. Leave the explanation of the code for last, and write it only for the parts people have to change.
Why complete documentation is the wrong target
A full description of an old system is a project that rarely gets finished, and most of it would never be read. Documentation is worth writing when a particular person will need it at a particular moment. For a system with none, three people matter, in this order.
- The person who has to get it running again when it fails.
- The person who has to change it without breaking something else.
- The person who has to decide whether to keep it, modernize it or replace it.
The steps below follow that order.
1. Write the page for the person who has to get it running again
This is the document you will want most on the worst day, so it comes first. One page is enough.
- Where the system runs, and which accounts and credentials reach it.
- How to tell whether it is working: the address to check, the job that should have finished, the log to read.
- How to restart it, in the order the parts have to come up.
- How to restore it from backup, and where the backups are.
- What fails most often, and what has fixed it before.
- Who to call: the vendor, the hosting provider, the person in the business who depends on it.
Write it by doing each task and noting what you did, because a page written from memory leaves steps out. Step 3 of How do you reduce key-person risk on a small IT team? describes the same page, and step 4 describes how to test it.
2. Record what the system connects to
Most surprises in an undocumented system are at its edges. A change that looks safe inside the application breaks a report, a file transfer or another system that nobody knew was reading from it.
You can find most of this without anyone’s memory, because the running system holds it.
- The scheduled tasks on the server and the jobs in the database show what runs on a timer.
- The configuration files and connection strings show which databases and services the application calls.
- The database’s own records of logins show what else connects to it: reporting tools, spreadsheets, other applications.
- The firewall rules and the network traffic show what it talks to outside the building.
- The mail settings show what it sends, and the folders it reads and writes show the file transfers.
Put the result in one diagram with the system in the middle and a line for each connection. On each line, write what moves, in which direction and how often.
3. Write down what it does for the business
The code says what the system does. The people who use it know which of those things the business depends on.
Sit with them while they work. Ask them to do their ordinary tasks and the ones that come once a month or once a year. Write down each task in a sentence or two: who does it, what they enter, and what comes out and where it goes. Note the workarounds, because a workaround marks a place where the system and the business have drifted apart.
An accurate list of these tasks is worth more than a manual, and it is what a replacement would have to match.
4. Describe the data
For the database, a reader needs three things. The first is the main tables and how they relate, which most database tools will draw for you. The second is what the important fields mean, especially the status codes and flags whose values are explained nowhere. The third is which system is the source of each kind of record, where the same customer or item lives in more than one place.
Ask the person who writes the reports. They have usually worked out more of this than anyone else.
5. Record how a change is built, tested and released
Have someone set the system up on a fresh machine from the repository alone, and write down every step, including each one that failed. Do the same for a release. The notes from those two exercises are the developer documentation, and they are accurate because they were just used.
6. Explain the code only where people change it
Do not describe the code file by file. A line-by-line description is out of date as soon as the code changes.
Write a short overview of the main parts and what each is responsible for. After that, write when there is a reason: someone has just worked out why an odd piece of code exists, or has just made a decision the next person will wonder about. A few sentences at that moment, kept beside the code, are worth more than a document written later from memory.
An AI coding assistant can read a codebase and draft that overview quickly. Treat the draft as a starting point. It reports what the code says, it cannot know why, and it can be wrong with confidence, so check it against the running system. Use a tool your company has approved, because source code and configuration files often contain credentials.
How to keep it from going out of date
- Put a date and an owner’s name on each document. An undated page cannot be trusted.
- Update the document as part of the work. A change to the system is finished when its notes are.
- Have someone new use it. Each question they have to ask becomes a line in the document.
- Delete what is wrong. A page that misleads does more harm than a missing one.
Common questions
Who should write the documentation? The person who is learning the system. Someone who already knows a system leaves out what seems obvious to them, and someone who is learning it writes down each thing they had to ask.
How much documentation is enough? Enough that a capable engineer who has never seen the system can restore it, release a small change to it and say what it connects to. Past that point, write only about the parts people actually change.
Can an AI tool write the documentation from the code? It can produce a useful first draft of what the code does. It cannot tell you why a decision was made, what runs on the server outside the code, or what the business relies on. Someone has to check the draft against the running system.
Where should the documentation be kept? Next to the code, in the same repository, for anything about building and changing the system. Keep the page on how to run and restore it somewhere people can still reach when the system and the network are down.
If nobody on your team has the time to read the system, a System Evaluation gives you an independent written account of it, with architecture diagrams, for a fixed fee.