How We Update a Joomla Website with a Modified Core

Note: Make sure you backup your Joomla website before following the guide below. You should backup both the filesystem and the database.

We are lately getting many Joomla 2.5.x websites with modified core to update to the latest version of Joomla. Obviously, this is a very delicate task because a Joomla update can (and most likely will) erase all the core modifications that were done on the website, or worse, erase some of the core modifications (while leaving some modifications) and potentially make the Joomla website unstable.

Probably your question is, “How do these guys do it?” Well, here’s how:

  • We first download a clean copy of Joomla with the exact version that the client has. For example, if the client has version 2.5.11, then we download a fresh copy of Joomla 2.5.11 from Joomla’s official website. Clearly, the version that we download from is untampered with.
  • We then extract the downloaded Joomla installation file to a folder called clean, under the root of our client’s Joomla website.

  • We then loop recursively through all the files in the clean folder, and we compare them to their peers on the actual website. For example, we compare the file articles.php in the folder clean/components/com_content/models to the file articles.php which is located in the folder components/com_content/models. We compare the files using the md5_file function.

  • If, during the loop, we find that a file is not identical to its peer, then we store the full path of that file in a file called modified.txt, which is located under the root directory of the website. We then continue the loop. When the loop ends, we will have the full path of all the modified files stored in the modified.txt file.

  • We then download the most recent copy of Joomla (e.g. 2.5.17 at the time of publishing this post), and then we extract it to a folder called v2 under the root directory of the website (the same as if we’re doing a migration).

  • Now the real and challenging work begins: we check each modified file (which path we have in the modified.txt file) for the modifications (we compare it manually with the file of the same Joomla version), and then we port the changes to the identical file of the latest Joomla version. In other words, if the file articles.php under the components/com_content/models was modified, then we port those modifications to the file articles.php which is located under the v2/components/com_content/models folder).

  • Once we finish porting all the file modifications, we copy all the files from the v2 directory to the root directory of the Joomla website, essentially overwriting the existing files.

  • That’s it! The Joomla website is updated and the core modifications are preserved.

As you can see, the process is a bit hard and delicate, and requires an experienced Joomla (and PHP) developer. If you don’t consider yourself falling into this category, then you might want to hire one who does (well, you can always hire us!).

Some caveats

  • Some Joomla websites not only have their core modified, but they also have their database modified. Technically, this shouldn’t cause any problem, but we’re usually extra careful when we work on such websites.
  • Ensure that your Joomla error reporting is set to None in the global configuration settings when you do the update. Otherwise, your visitors might see errors that might compromise the security of your website.

  • This guide only works for an update, and not for a migration. In other words, it won’t work if you’re moving from 1.5 to 2.5, or from 2.5 to 3.x.

We hope that you found our guide helpful. If you need help implementing it, then we’re always here for you. Just contact us and we’ll do the update for you in as little time as possible for a very affordable cost.

One Response to “How We Update a Joomla Website with a Modified Core”
  1. Pingback by Don’t Update Everything on Your Joomla Website in One Shot! | itoctopus — February 10, 2014 @ 1:27 pm

    […] thing that you should do is to update Joomla’s core (if you have a modified core, then check this guide on how to do it). Then, you should wait for a week or so, to make sure that your website is stable, […]

Leave a comment