where lives old db (version of mariadb/mysql)?
where lives nee db (version of db engine)?
what type of password is used on old?
what type of password is used on new?
any more errors in logs(php and db)?
and the obvious have you check you use the right username , password, db name and address for both?
Your question about where the databases are located led me to the source of the error. The old database resides in the standard SME Server location for MySQL files as it and the ibay that accesses it were created long before I had added the MariaDB 10.5 contribution to the server in order to be able to test osCommerce 4 and ZenCart which will not work under MariaDB 5.5.
The new ibay in which I am creating the conversion program was created after the MariaDB 10.5 contribution had been installed. I had created the new database under MariaDB 10.5 and had specified the maridb105.sock per the contribution instructions in the mysqli_connect statement for the new database. However in the connection to the old database I didn't bother specifying the socket since leaving that out connects using the default PHP connection for MySQL which I assumed would be the MariaDB 5.5 native to SME Server.
After looking at the db logs as you suggested I found that the connection errors were not shown in the standard MariaDB logs but were instead shown in the logs for MariaDB 10.5. Once I specified that the old db connection was supposed to use mysql.sock I had no trouble connecting.
Apparently adding the MariaDB 10.5 contribution secretly changes the default PHP database socket for all ibays that are created after it is installed but does not change it for any ibays created before the contribution is installed. It would have been nice if this database socket change showed up in the Web Hosting contribution as it would have made spotting the difference between the ibays much easier.
Is there a config setting for SMEServer that will show the PHP MySQL socket setting for a specific ibay or, for that matter, any ibay specific PHP settings?