I haven't done this myself, but as far as I know this should work:
1. Install a brand-new wiki somewhere, without importing the old database in any way.
Install most recent versions of any extensions your old wiki used.
2. Merge your old LocalSettings.php with the newly generated ones; just copy over any
custom settings and extension requires. Wiki configuration options are very rarely changed
in an incompatible way, but you might want to look through release notes for each version
to check. (Copy over uploaded files as well, if you had any; do not copy MediaWiki .php
and other files.)
3. *Drop* all of the database tables of the new wiki. Don't just empty them
(TRUNCATE), remove them entirely (DROP).
4. Import the old database in the same place (pay attention to table name prefixes).
5. Run `php maintenace/update.php`, as if you were just updating the wiki.
Do not update step-by-step if you can avoid it: some versions had bugs in the updater
which were later fixed. You should be able to update straight from 1.5 to 1.21 (and it
might work for even earlier versions as well, but they had a very different database
schema, so it might be troublesome).
Please report back if it works, or if you run into any problems :)