Update/Upgrade Joomla from version 3.1.x to 3.9.x

This article shows how you can update or upgrage Joomla from version 3.1.x to 3.9.26

Enable Maintenance Mode

1) From administrator login

  • Login to Joomla administrator

  • Go to System –> Global Configuration

  • On the “Site” tab, there is a setting called “Site Offline”.

  • Set it to “Yes”

  • Once you change it to “Yes”, then three new fields are shown

Offline Message
Custom Message
Offline Image

  • Make necessary changes in those fields.

  • Click on “Save” button

2) From configuration.php file

Maintenance mode can be enabled directly by editing the configuration.php file as well.

public $offline = '1';
public $offline_image = '';
public $offline_message = 'This site is down for maintenance.<br /> Please check back again soon.';
public $offline_image = '';

Check update sites

Update sites are present on the database table “YourPrefix_update_sites“.


SELECT * FROM `YourPrefix_update_sites`;

The “Joomla Core” update site location is https://update.joomla.org/core/list.xml

The list.xml file contains the following:

<extensionset name="Joomla Core" description="Joomla! Core">
<extension name="Joomla" element="joomla" type="file" version="2.5.28" targetplatformversion="2.5" detailsurl="https://update.joomla.org/core/extension.xml"/>
<extension name="Joomla" element="joomla" type="file" version="3.1.3" targetplatformversion="3.1.2" detailsurl="https://update.joomla.org/core/sts/extension_sts.xml"/>
<extension name="Joomla" element="joomla" type="file" version="3.2.7" targetplatformversion="3.0" detailsurl="https://update.joomla.org/core/sts/extension_sts.xml"/>
<extension name="Joomla" element="joomla" type="file" version="3.2.7" targetplatformversion="3.1" detailsurl="https://update.joomla.org/core/sts/extension_sts.xml"/>
<extension name="Joomla" element="joomla" type="file" version="3.2.7" targetplatformversion="3.2" detailsurl="https://update.joomla.org/core/sts/extension_sts.xml"/>
<extension name="Joomla" element="joomla" type="file" version="3.6.5" targetplatformversion="3.2.7" detailsurl="https://update.joomla.org/core/sts/extension_sts.xml"/>
<extension name="Joomla" element="joomla" type="file" version="3.6.5" targetplatformversion="3.3" detailsurl="https://update.joomla.org/core/sts/extension_sts.xml"/>
<extension name="Joomla" element="joomla" type="file" version="3.6.5" targetplatformversion="3.4" detailsurl="https://update.joomla.org/core/sts/extension_sts.xml"/>
<extension name="Joomla" element="joomla" type="file" version="3.6.5" targetplatformversion="3.5" detailsurl="https://update.joomla.org/core/sts/extension_sts.xml"/>
<extension name="Joomla" element="joomla" type="file" version="3.9.26" targetplatformversion="3.6.5" detailsurl="https://update.joomla.org/core/sts/extension_sts.xml"/>
<extension name="Joomla" element="joomla" type="file" version="3.6.5" targetplatformversion="3.6" detailsurl="https://update.joomla.org/core/sts/extension_sts.xml"/>
<extension name="Joomla" element="joomla" type="file" version="3.9.26" targetplatformversion="3.7" detailsurl="https://update.joomla.org/core/sts/extension_sts.xml"/>
<extension name="Joomla" element="joomla" type="file" version="3.9.26" targetplatformversion="3.8" detailsurl="https://update.joomla.org/core/sts/extension_sts.xml"/>
<extension name="Joomla" element="joomla" type="file" version="3.9.26" targetplatformversion="3.9" detailsurl="https://update.joomla.org/core/sts/extension_sts.xml"/>
</extensionset>

As shown in the above XML file:

  • If you have Joomla version 3.1 then it will first get updated to version 3.2.7.
  • After 3.2.7, it will get updated to version 3.6.5.

  • Finally, after version 3.6.5, your Joomla will get updated to version 3.9.26.

Fix for error “No HTTP response received”

  • Login to your Joomla administrator.
  • Go to menu Components --> Joomla! Update

You might see a blank screen with a message:

No HTTP response received.

This is because of broken links in the <em>YourPrefix_update_sites</em> table.

Check all the “location” column links in the database table YourPrefix_update_sites. If any link is not working then disable that entry.

UPDATE `YourPrefix_update_sites` SET enabled = 1 WHERE update_site_id = YOUR_UPDATE_ID;

There are two types of update sites in that table. One type is “collection” and the other type is “extension”. Generally, the extensions have broken links. You can disable all the extension types as well.


UPDATE `YourPrefix_update_sites` SET enabled = 1 WHERE type = 'extension';
  • Refresh the page of Components --> Joomla! Update
  • Click on the “Check for Updates” button

If you are on Joomla! version 3.1, then it will show you to update to Joomla version 3.2.7.

  • Click on the Update button.
  • Once the update is completed, go to the menu “Extensions –> Manage”.

  • Click on the “Discover” submenu.

  • If there are extensions listed, then select those extensions and click on the “Install” button.

  • Now, click on the “Database” submenu.

  • If there are any database-related errors, then they will be displayed on this page.

  • Click on the “Fix” button to fix the database errors.

Fix error: “Table joomla.#__banners doesn’t exist”

You might also get an error saying “Table joomla.#__banners doesn’t exist”.

Run the following SQL queries to create banners and related tables.


--
-- Table structure for table `YourPrefix_banners`
--

CREATE TABLE `YourPrefix_banners` (
  `id` int(11) NOT NULL,
  `cid` int(11) NOT NULL DEFAULT '0',
  `type` int(11) NOT NULL DEFAULT '0',
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `alias` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  `imptotal` int(11) NOT NULL DEFAULT '0',
  `impmade` int(11) NOT NULL DEFAULT '0',
  `clicks` int(11) NOT NULL DEFAULT '0',
  `clickurl` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `state` tinyint(3) NOT NULL DEFAULT '0',
  `catid` int(10) UNSIGNED NOT NULL DEFAULT '0',
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `custombannercode` varchar(2048) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sticky` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  `ordering` int(11) NOT NULL DEFAULT '0',
  `metakey` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `params` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `own_prefix` tinyint(1) NOT NULL DEFAULT '0',
  `metakey_prefix` varchar(400) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `purchase_type` tinyint(4) NOT NULL DEFAULT '-1',
  `track_clicks` tinyint(4) NOT NULL DEFAULT '-1',
  `track_impressions` tinyint(4) NOT NULL DEFAULT '-1',
  `checked_out` int(10) UNSIGNED NOT NULL DEFAULT '0',
  `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `publish_up` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `publish_down` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `reset` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `language` char(7) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `created_by` int(10) UNSIGNED NOT NULL DEFAULT '0',
  `created_by_alias` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `modified_by` int(10) UNSIGNED NOT NULL DEFAULT '0',
  `version` int(10) UNSIGNED NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `YourPrefix_banner_clients`
--

CREATE TABLE `YourPrefix_banner_clients` (
  `id` int(11) NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `contact` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `extrainfo` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `state` tinyint(3) NOT NULL DEFAULT '0',
  `checked_out` int(10) UNSIGNED NOT NULL DEFAULT '0',
  `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `metakey` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `own_prefix` tinyint(4) NOT NULL DEFAULT '0',
  `metakey_prefix` varchar(400) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `purchase_type` tinyint(4) NOT NULL DEFAULT '-1',
  `track_clicks` tinyint(4) NOT NULL DEFAULT '-1',
  `track_impressions` tinyint(4) NOT NULL DEFAULT '-1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `YourPrefix_banner_tracks`
--

CREATE TABLE `YourPrefix_banner_tracks` (
  `track_date` datetime NOT NULL,
  `track_type` int(10) UNSIGNED NOT NULL,
  `banner_id` int(10) UNSIGNED NOT NULL,
  `count` int(10) UNSIGNED NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `YourPrefix_banners`
--
ALTER TABLE `YourPrefix_banners`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_state` (`state`),
  ADD KEY `idx_own_prefix` (`own_prefix`),
  ADD KEY `idx_metakey_prefix` (`metakey_prefix`(100)),
  ADD KEY `idx_banner_catid` (`catid`),
  ADD KEY `idx_language` (`language`);

--
-- Indexes for table `YourPrefix_banner_clients`
--
ALTER TABLE `YourPrefix_banner_clients`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_own_prefix` (`own_prefix`),
  ADD KEY `idx_metakey_prefix` (`metakey_prefix`(100));

--
-- Indexes for table `YourPrefix_banner_tracks`
--
ALTER TABLE `YourPrefix_banner_tracks`
  ADD PRIMARY KEY (`track_date`,`track_type`,`banner_id`),
  ADD KEY `idx_track_date` (`track_date`),
  ADD KEY `idx_track_type` (`track_type`),
  ADD KEY `idx_banner_id` (`banner_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `YourPrefix_banners`
--
ALTER TABLE `YourPrefix_banners`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `YourPrefix_banner_clients`
--
ALTER TABLE `YourPrefix_banner_clients`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
SET FOREIGN_KEY_CHECKS=1;
COMMIT;

Upgrade from Joomla version 3.2.7 to 3.6.5

Now, your Joomla is updated to version 3.2.7.

We repeat the same process to upgrade to version 3.6.5.

  • Go to menu Components --> Joomla! Update

It will show that the next update is to version 3.6.5.

  • Click on the Update button.
  • Once the update is completed, go to the menu “Extensions –> Manage”.

  • Click on the “Discover” submenu.

  • If there are extensions listed, then select those extensions and click on the “Install” button.

  • Now, click on the “Database” submenu.

If there are any database-related errors, then they will be displayed on this page.

  • Click on the “Fix” button to fix the database errors.

Upgrade from Joomla version 3.6.6 to 3.9.26

Now, your Joomla is updated to version 3.6.5.

We repeat the same process to upgrade to version 3.9.26.

  • Go to menu Components --> Joomla! Update
  • It will show that the next update is to version 3.9.26.

  • Click on the Update button.

Sometimes the update button might not work. In my case, when I clicked on the update button, the update process got stuck. It didn’t show any progress.

To solve this, I downloaded the upgrade package from the Joomla website and copied it to the root folder of my Joomla installation.

The upgrade package for version 3.9.26 is at the bottom of this page: https://downloads.joomla.org/cms/joomla3/3-9-26

Download, extract and copy the contents into the root folder of your Joomla installation.

After you update to 3.9.26, you might get a blank white screen on both the frontend and admin of your Joomla site.

There can be PHP error which might have got hidden if you have disabled error reporting from the configuration file.

  • Open the configuration.php file present on your Joomla installation root folder.
  • Set error_reporting value to “development”. It might be set as “none”.

public $error_reporting = 'development';

Now, refresh your Joomla site link.

In my case, I saw the following error message:

Fatal error: Call to undefined method JApplicationAdministrator::isClient() in /www/plugins/system/logout/logout.php on line 48

Solution:

Go to: https://gist.github.com/mbabker/d7bfb4e1e2fbc6b7815a733607f89281

Download postupdate.php

Copy the postupdate.php file to your site’s administrator directory.

You can either access this script via a web request (https://www.example.com/administrator/postupdate.php) or from the command-line interface (php /path/to/administrator/postupdate.php).

After that, open your site: https://www.example.com/administrator

Now, you will be able to see the site pages normally.

  • Go to the menu “Extensions –> Manage”.
  • Click on the “Discover” submenu.

  • If there are extensions listed, then select those extensions and click on the “Install” button.

  • Now, click on the “Database” submenu.

If there are any database-related errors, then they will be displayed on this page.

  • Click on the “Fix” button to fix the database errors.

  • Finally, go to Components –> Post-installation Messages menu. Follow the instructions given there.