We have had a few jobs to make Joomla work with Oracle instead of MySQL, and we can say for sure that it’s not a job for beginners. Yes, Joomla can work with Oracle as a database, but the problem is that it needs modification in its core for it to be able to do so. But why is that? Why isn’t the process easier?
The reason why the process is hard and is not about flipping a switch is that Joomla was first designed with MySQL and only MySQL in mind. Of course, MySQL complies with nearly all the database standards out there, but Oracle, from our experience, doesn’t. Oracle is a much more complicated server and does not usually install, nor work, in a few seconds. Usually, developers are “thrilled” when they are able to connect to an Oracle database, and “exalted” when they’re able to add/retrieve information from it for the first time. When was the last time a developer was that happy that he connected to a MySQL database? Yes, we figured so!
Let’s move into the technicals on why Joomla cannot run on Oracle by default:
- The database and table creation script does not work without modification.
- The connection and the database class are written to connect to MySQL and not to Oracle (so they all use MySQL functions).
- Some of the extensions use native MySQL functions directly, instead of connecting using the Joomla Database interface (class).
Now here’s how we make Joomla work on Oracle:
- We fix the SQL installation script to accommodate the Oracle database in case of a new installation. In the case of an existing installation, we export all the database, as well as its data to a SQL file, and then we modify the SQL file (using find and replace) to make it work with an Oracle database.
- We load the modified installation file or the modified exported SQL file into the Oracle database.
- We then create a copy of the Joomla database class, and then we modify all the functions to work with Oracle instead of MySQL.
- We ensure that the Oracle drivers are properly installed and loaded by the php.ini file.
- We rename the original MySQL database (you will know in the next step why) to something like database_name_old.
- We switch to the new database class and fully test the website to see if some extensions are not working. If an extension ceases to work then it is a sign that this extension is calling the original MySQL database (which no longer exists because it was renamed) directly.
The process usually takes us around 3 days (a day consists of 8 hours). It may take more depending on the number of extensions installed. If you want to move your Joomla database to Oracle or you need to have a fresh Joomla installation with Oracle as a database, then just contact us, we have helped others in achieving this goal and we are confident we can help you!