Database migration: from MySQL to DB2
- Milo
- Nette Core | 1283
You are using Nette\Database, right?
Nette\Database (NDB) uses PHP PDO drivers. There is no native PDO driver for IBM DB2, you must use ODBC. I suppose, you have a working ODBC driver and you are able connect to DB2.
If so, NDB require own SupplementalDriver like these. For ODBC-DB2 this driver does not exist. You must write own one and pass it into Nette\Database\Connection.
Last edited by Milo (2013-04-29 10:17)
- Milo
- Nette Core | 1283
Well, dibi hasn't native DB2 driver, but has a ODBC driver. So, if you can configure ODBC, use it with dibi. It is the easiest way.
Next option is to write own DibiDB2Driver driver. It is more or less easy. I would like to help you, but I'm not a owner of IBM DB2 running server.
But if you want leave dibi and use another database layer, you must rewrite all parts of the application with database code. Config change only does not help you.
- madalina
- Member | 7
Thank you, Milo!
The plan is to leave Dibi and rewrite the sql queries in the application.
But I can't figure out how to modify config.neon to connect to the new
database. I tried something but I keep getting errors.
Do you know what should be the parameters for a DB2 database?