Set legacy database in Aegir context
Such definitions can be placed in a local.settings.php file, alongside the generated settings.php. 

You'll find an include statement at the bottom of the generated settings.php