Our Doha legacy modernization follows a structured methodology that prioritizes business continuity and knowledge preservation. Discovery and assessment (weeks 1-4): understanding the legacy system before attempting to replace it. Code archaeology: we reverse-engineer the legacy application — reading source code (VB6, Oracle Forms PL/SQL, Delphi, C++), running the application, and documenting every function, business rule, and edge case. This is painstaking work — legacy code often contains: undocumented business rules embedded in code (an IF statement that applies a 2.5% surcharge for specific transaction types — nobody remembers why, but removing it would cause incorrect calculations), workarounds for historical issues (code that reformats data because an upstream system sent it incorrectly 15 years ago — the upstream system has since been fixed, but the workaround remains), and Arabic text handling (hardcoded Arabic strings, character encoding workarounds for older systems that didn't support Unicode — these workarounds must be understood to ensure the modern system handles the same Arabic text correctly). Database analysis: the legacy database contains decades of accumulated data — and the data model contains accumulated complexity. We document: table relationships (often implicit — no foreign keys, just matching column names), data quality issues (inconsistent formats, orphaned records, duplicate entries — these must be addressed during migration), and historical data requirements (how much history must the new system contain — 5 years? 10 years? Everything?). User workflow documentation: observing actual users operating the legacy system — understanding not just what the system does, but how people use it. This reveals: workarounds (users copying data from the system into Excel for calculations the system can't perform), undocumented processes (steps that users perform that aren't in any procedure manual — "I always check this field because sometimes the system puts the wrong value"), and performance expectations (how long operations take in the legacy system — the new system must be at least as fast, or users will resist adoption). Modernization strategy (week 3-4): selecting the right approach for each component. Rewrite (build new): for systems where the legacy technology is completely obsolete (VB6, Oracle Forms 6i, Delphi) and the business logic is well-understood. Advantages: modern architecture, modern UI, modern integration capability. Risk: missing business rules during rewrite. Mitigation: extensive discovery, parallel running. Strangler fig pattern: for large, complex systems that can be decomposed — building new microservices around the legacy system, gradually routing functionality to the new services while the legacy system continues operating. Advantages: incremental migration (each step is small and reversible), no big-bang switchover. Best for: core banking systems, large government platforms. Replatform: for systems where the business logic is sound but the runtime is obsolete — migrating .NET Framework to .NET 8, or Java 6 to Java 21, preserving most of the code while updating the platform. Advantages: lower risk than rewrite, preserves proven business logic. Best for: systems with well-structured code that primarily need platform modernization. Encapsulate and extend: for systems where the legacy system must continue operating but modern capabilities (APIs, mobile access) are needed — wrapping the legacy system with modern APIs, adding new functionality in modern services while the legacy system handles core processing. Advantages: fastest path to modern capabilities, no business logic risk. Best for: systems where modernization budget is limited or timeline is urgent. Development (weeks 4-16): building the modern replacement. Technology stack (for rewrite): Next.js (Arabic-first web interface with RTL layout, Arabic search, Hijri date support), Node.js or .NET 8 (API layer — depending on the team's existing skills), PostgreSQL (database — with Arabic full-text search, proper Unicode support), and Redis (caching — critical for performance parity with desktop legacy applications, which feel fast because they run locally). Arabic-first design: every screen designed in Arabic first — not an English interface translated to Arabic. Arabic typography optimized for screen readability, Arabic search with morphological awareness, Arabic document generation (replacing legacy Arabic document generation that often used workarounds like RTF templates with hardcoded Arabic text). Business logic implementation: each business rule from the discovery phase implemented and tested individually — with test cases comparing the modern system's output to the legacy system's output for the same inputs. This "oracle testing" approach: using the legacy system as the reference for correctness. Data migration (weeks 12-18): migrating decades of accumulated data. Data cleaning: addressing data quality issues identified during discovery — deduplication, format standardization, orphan record resolution, and encoding conversion (legacy systems often storing Arabic text in Windows-1256 encoding — migrating to UTF-8). Migration scripts: automated, repeatable migration scripts (not manual data manipulation) — tested on copies of production data, refined, and re-tested until migration produces correct results. Migration validation: automated validation comparing source and target data — every record verified, every calculation cross-checked, every relationship confirmed. Parallel running (weeks 16-20): operating both systems simultaneously. Users: entering data into both systems (or the new system replicating transactions to the legacy system automatically). Output comparison: reports from both systems compared — any discrepancies investigated and resolved. The parallel run: providing confidence that the new system produces identical results to the legacy system — and identifying any missed business rules before the legacy system is decommissioned.