Upgrade to 2.9 problem

I’ve tried twice to upgrade our system to 2.9 , and ended up with this error on the

Unknown SQL engine: []
Trace Back
/replica/var/www/admin/common/db_connect.php:57 die_freepbx()
[0]: Unknown SQL engine: []

/replica/var/www/admin/bootstrap.php:75 require_once()
[0]: /replica/var/www/admin/common/db_connect.php

/replica/var/www/admin/config.php:61 require()
[0]: /replica/var/www/admin/bootstrap.php

so I searched the forum and noticed someone else had the same issue. one of the suggestions was to try from cli:

cd /var/lib/asterisk/bin
./module_admin help
PHP Notice: Undefined variable: amp_conf in /replica/var/lib/asterisk/bin/module_admin on line 652
PHP Warning: chdir(): No such file or directory (errno 2) in /replica/var/lib/asterisk/bin/module_admin on line 652
PHP Fatal error: Call to undefined function out() in /replica/var/lib/asterisk/bin/module_admin on line 371

so I manually restored last nights backup again…

Any suggestions to get around this?