Skip to main content

Errors when updating old versions of Joomla!

| Gianluca Gabella | Joomla!
share on facebook share on twitter share on linkedin

Index:


It often happens that you have to update very old versions of Joomla. If you come across a site that has not been updated regularly, version by version, there is a chance that you will have to make considerable leaps.

In this blog post, I will not be able to cover all the possible problems that might crop up, but I will try to give some detailed information on some of the most common ones.

ERROR: AJAX Loading Error: Internal Server Error

ERROR: AJAX Loading Error: Internal Server Error durante l'aggiornamento di Joomla

What you see above is the most common error that pops up when attempting an automatic Joomla update. In my case I was trying to upgrade a Joomla 3.6.x to a 3.7.0. Why did I make such a 'small' version jump? Joomla gives you the possibility to jump directly to the latest version: in a Joomla 3.6 if you click on the "update Joomla" component it will propose you to jump directly to 3.9. This is a practice I do not recommend, because between 3.6 (or older version) and the latest 3.9.x the world has changed. Many things have been changed, updated or even deleted.

Always proceed in steps! 3.6 -> 3.7 -> 3.8 -> 3.9 and so on.

Let's make a good backup of the current site!

The following steps radically alter the site's files and database. They are very invasive and the possibility of something going wrong is HIGH. The very first thing that needs to be done is a good backup of the site: if something catastrophic happens, there is a chance of returning to a stable situation.

My advice is to use Akeeba Backup. You can read a complete guide on how to use it directly in this blog. In case there is no version of Akeeba Backup available for your site, a nice handmade backup of the files via FTP and the database is also fine.

Download the right update version.

The official joomla site also allows you to download old versions of the CMS. This feature is essential to be able to upgrade step by step. In our case we need the update package from 3.6 to 3.7. So let's download them from the main page or directly from the 3.7 version page.

The package we need is NOT the first (i.e. the FULL package) because this is the one to use in case you want to install a joomla from scratch.

The package we need is the UPGRADE PACKAGE, i.e. the one needed to update Joomla starting from an already existing and working site.

upgrade package

The ZIP version is fine.

We now proceed with the update by hand. We click from the top menu on "components" -> "update joomla". However, we do not start the automatic update, but click on "upload and update":

carica e aggiorna

With "browse" we select the update file we downloaded from the Joomla.org site and click on "Upload and install".

Managing error

If you have arrived on this page at this point, the AJAX error mentioned above should have popped up. Don't Panic!

In 90% of cases, it is a permissions problem. In dozens of sites I have updated, the problem was mainly the hosting being outdated or not fully compatible with Joomla.

The recommended file and folder permissions for Joomla are 644 for files and 755 for folders.

It may be that some files are 777. Maybe everything works but 777 is a setting that should always be avoided because it brings with it a lot of security problems.

Having said that, if you have no way or desire to change the permissions of all the files by hand (you can do this via FTP with Filezilla, for example), some hosts have tools to fix the permissions automatically.

For example, Aruba (which is the hosting that has given me the most problems on old sites) has a handy tool in the "Tools and Settings" of the Linux server called "Repair Permissions":

riparazione permissions

Click on it, a small window will open where you have to click 'ok' to start the procedure

permessi directories

Once we have clicked on 'ok' we let the system wait a few minutes so that it can update the file and folder permissions.

If everything went well, we can try again to load the update package and repeat the update.

In many cases, this step is sufficient to update the site to the next version.

The update went well!

Great! At this point, just go on from version to version until you get to the latest one, so 3.6 to 3.7, 3.7 to 3.8, and so on. It may be that between updates you need to repeat the file and folder permissions fix.

One last thing I recommend you do with each update is to "explore" new available extensions and fix any database errors. This can be done from the menu Extensions -> Management:

esplora database

Something went wrong, the update started but froze in the middle or at the end!

This case is unfortunately also quite common. It happens that the update crashes at some point and strange (or serious, like Internal Server Error) errors pop up. This happens when the final part of the update is not executed correctly by the script and the system 'breaks down'. There is a manual script on github for use in such cases.

The direct link is this: https://gist.github.com/mbabker/d7bfb4e1e2fbc6b7815a733607f89281#file-readme-md

How does it work? And how do I use it?

Gli step da fare sonoThe steps are as follows i seguenti:

  1. Download and install from the joomla.org site the ZIP package of the Joomla version you want to install (e.g. if you upgrade from 3.6 to 3.7 you have to download the Joomla! 3.7.0 Full Package (.zip) )
  2. Unzip the archive and then upload all files to the server via FTP except the installation folder. Choose to overwrite all existing files.
  3. Delete the folder /libraries/cms/version/
  4. Now use the script I have linked

The use is very simple, first copy all the PHP code (here the raw version) and paste it into a text file which you will call postupdate.php

Upload the file into the "administrator" folder of your site.

Now open a browser and go to the link www.YOURSITE.it/administrator/postupdate.php.

The PHP script will start working to complete the update steps.

After a few seconds, you should return to the administrator screen. I advise you to exit and re-enter the administrator (or reload the page in case of error 500). If everything went well then you should see your Joomla site back online and updated to the version you uploaded.

WARNING: After updating with the php script, remember to delete the postupdate.php file from the server!

The website is still not working!

Here we enter the realm of infinite possibilities. Anything could have happened: corrupt files, incompatible extensions, outdated databases. There can be thousands of solutions, but the best way to start doing some serious debugging is to check the specific errors. Every hosting gives the possibility of reading Apache error logs. Ask your hosting company to take a look at them for you, from there you can tell if there is any file generating errors or some non-compatible plugin blocking the site.


If you liked this article, please share it!

share on facebook share on twitter share on linkedin
condividi su Facebookcondividi su Twittercondividi su LinkedIncondividi su WhatsAppcondividi su Telegram