Take the 2-minute tour ×  This question already has an answer
here:  We have a legacy system to bring up-to-date because:
1. It uses an unpopular (amoung our users) non-sql database
(Btrieve)   2. Provides only a text interface   3. Is written in
Turbo Pascal (but compiled in free pascal) which is hard to
recruit/retain developers to maintain it  To give you an idea of
the scale, the code base is 15MB over 756 files.  All the
studies I've looked in to such as those listed here suggest it
is vastly more expensive to rewrite than to adapt what you have.
If I thought we could encapsulate the legacy stuff behind a web
service and then design new client(s), that would be fine. But
I'm stuck with this legacy database which 90% of those 756 files
reference.  We even attempted replacing the low-level DB code
with code to convert to SQL, and while it worked fine, it was
too slow because the code is still accessing records one at a
time generating far too many SQL statements than it would need.
Plus this approach d