3

I have a Joomla installation, version 3.5+, but I cannot update, no matter what I tried. I tried to use the Joomla Update component, tried to upload the package, it just doesn't work.

I then tried to extract the package on the root directory, and it broke my site.

How can I manually update it?

3 Answers 3

4

Many posts around say that you shouldn't manually update Joomla 3.5+. And there are various reasons that this is good advice.

However, you can manually update Joomla 3.5+ to the latest version (currently 3.8.8).

1. Backup first

First, you need to have a good, working backup of your current site. Things may go wrong.

2. Login to administrator

It's important to have an active session in the site's administrator, while it is still working, or step 4 may not work.

3. Extract the files

You can download the latest Joomla upgrade package, either from your Joomla Update component (Components > Joomla Update), or from downloads.joomla.org.

Rename your libraries directory to libraries-old.

Place the package you downloaded in the root directory of your site. Extract.

If you open your front-end, and get an error, or a blank page, you can try to rename the libraries directory again, to libraries-broken and copy a libraries directory directly from the latest version full package.

4. Fix Database

If you have done well so far, your administrator should be broken. If not, hurray! Go to Extensions > Manage > Database and click the Fix button.

If your administrator is broken, copy the following link after your site's administrator URL:

[your site]/administrator/index.php?option=com_installer&view=database&task=database.fix

If you click that link, the database should be automatically fixed, and your administrator will be usable again. Click Fix one more time.

Your site should now have the latest Joomla version. If you still have problems with it, you may need to update third-party extensions, or similar.

3
  • You can often install the update packages through the installer too. Which is not manually, but if the auto updater is not working that might still be a solution for you.
    – Eoin
    May 26, 2018 at 11:35
  • 1
    I thought that it would work that way too, but when I tried it and also got the Ajax loading error, I decided to write what I found here. May 26, 2018 at 15:24
  • This worked for me and I finally upgraded from 3.5.x to the latest 3.9.x. For me the page was blank, however the admin panel worked. I also copied the Libraries from the full release. The issue with homepage was indeed caused by extensions. Thank you, I was literally stuck on 3.5.x since it came out.
    – Hrcak
    Apr 18, 2020 at 13:57
3

Michael Babker has provided a Post-Manual Update Script at https://gist.github.com/mbabker/d7bfb4e1e2fbc6b7815a733607f89281 which runs the steps normally performed after the filesystem updates.

This script is designed to be run after you have manually extracted the update package over your site.

As always, you should run a backup of your website before attempting any major update like this one.

Below is the current copy of the code, but as the linked page may be updated in future, be sure to check that you are using the latest version.


postupdate.php file as of 15 Sep 2019:

<?php
/**
 * @package    Joomla.Administrator
 *
 * @copyright  Copyright (C) 2016 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */
/**
 * Define the application's minimum supported PHP version as a constant so it can be referenced within the application.
 */
define('JOOMLA_MINIMUM_PHP', '5.3.10');
if (version_compare(PHP_VERSION, JOOMLA_MINIMUM_PHP, '<'))
{
    die('Your host needs to use PHP ' . JOOMLA_MINIMUM_PHP . ' or higher to run this version of Joomla!');
}
/**
 * Constant that is checked in included files to prevent direct access.
 * define() is used in the installation folder rather than "const" to not error for PHP 5.2 and lower
 */
define('_JEXEC', 1);
// Load the administrator application's path constants
if (file_exists(__DIR__ . '/defines.php'))
{
    include_once __DIR__ . '/defines.php';
}
if (!defined('_JDEFINES'))
{
    define('JPATH_BASE', __DIR__);
    require_once JPATH_BASE . '/includes/defines.php';
}
require_once JPATH_BASE . '/includes/framework.php';
require_once JPATH_BASE . '/includes/helper.php';
// Account for moved JToolbarHelper class in 3.9
if (file_exists(JPATH_BASE . '/includes/toolbar.php'))
{
    require_once JPATH_BASE . '/includes/toolbar.php';
}
else
{
    require_once JPATH_BASE . '/includes/subtoolbar.php';
}
// Boot JApplicationAdministrator so the application references in the factory resolve correctly.
JFactory::getApplication('administrator');
// Set the component path (un)constants
define('JPATH_COMPONENT', JPATH_ADMINISTRATOR . '/components/com_joomlaupdate');
define('JPATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . '/components/com_joomlaupdate');
define('JPATH_COMPONENT_SITE', JPATH_SITE . '/components/com_joomlaupdate');
// Load the update component's model to run the cleanup methods
JModelLegacy::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/models', 'JoomlaupdateModel');
/** @var JoomlaupdateModelDefault $model */
$model = JModelLegacy::getInstance('default', 'JoomlaupdateModel');
// Make sure we got the model
if (!($model instanceof JoomlaupdateModelDefault))
{
    echo 'Could not load update component model, please check the logs for additional details.' . PHP_EOL;
    exit(1);
}
// Load up the logger
JLog::addLogger(
    array(
        'format'    => '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}',
        'text_file' => 'joomla_update.php',
    ),
    JLog::INFO,
    array('Update', 'databasequery', 'jerror')
);
JLog::add('Starting manual update using postupdate', JLog::INFO, 'Update');
// Load the Joomla library and update component language files
JFactory::getLanguage()->load('lib_joomla');
JFactory::getLanguage()->load('com_joomlaupdate');
JLog::add(JText::_('COM_JOOMLAUPDATE_UPDATE_LOG_FINALISE'), JLog::INFO, 'Update');
// Finalize the update
if ($model->finaliseUpgrade() === false)
{
    echo 'Failed to finalize the upgrade, please check the logs for additional details.' . PHP_EOL;
    exit(1);
}
JLog::add(JText::_('COM_JOOMLAUPDATE_UPDATE_LOG_CLEANUP'), JLog::INFO, 'Update');
// Cleanup after the update
$model->cleanUp();
JLog::add(JText::sprintf('COM_JOOMLAUPDATE_UPDATE_LOG_COMPLETE', JVERSION), JLog::INFO, 'Update');
JLog::add('Finished manual update using postupdate', JLog::INFO, 'Update');
echo 'Update to ' . JVERSION . ' completed successfully.' . PHP_EOL;
2

"Manually updating" is not a well-defined term. The technique that involves downloading an installation package, extracting the files (or a subset of those files) and replacing the existing filesystem used by a J! website, is not supported by the Joomla! project and is likely to break existing websites. Some people refer to this technique as the "manual" update method. While it may have been possible in the past to update Joomla! by overwriting the existing filesystem this way—and this was the only method available in J! 1.0—this approach does not work today. The only supported updating method is to use the Joomla! Update component.

It may have been possible, on occasions, for people to "update" Joomla! by overwriting the existing filesystem with files and to patch the database afterwards but these approaches usually end in failure. For those reasons, if people resort to "manual" update methods, the results are unpredictable.

Some people use the term "manual update" when it involves using the Upload & Update feature of the Joomla! Update component; this is not a manual update: it is a crutch to be used on occasions when the Live Update feature fails for some reasons. There may be other reasons why the Joomla! Update component does not work (e.g. inappropriate PHP environmental settings, inability to connect to the internet, etc.). Replacing or overwriting files is not a panacea for these issues and almost always causes more problems than it attempts to cure.

It is better to understand the causes for why people may be unable to use the Joomla! Update component—and resolve those issues—that it is to recommend workarounds that may work in a handful of situations but generally do not work for most people.

5
  • Wow, sozzled, at long last you make your appearance! Welcome to JSE. Please take our tour to help you to settle into the community. I trust you will quickly learn the nuances between JSE and Joomla Forum. We have plenty of new and historic content for you to review. If you find any suboptimal advice please offer clear constructive feedback on how to improve it -- this will vastly improve our content quality and the researcher experience.
    – mickmackusa
    Mar 6 at 3:22
  • Please bear in mind that all answers are expected to resolve the asked question. If this answer was solely aimed at another answer and did not attempt to resolve the asked question, then it would be deleted as Not An Answer to uphold the designed UX. I should also remind you that (different from the chronological posts of a Forum thread), the order of answers here are liable to move. This means that you cannot vaguely refer to moving targets as "The method described above" -- it may actually become "a method below". You may edit as much as you like at any time.
    – mickmackusa
    Mar 6 at 3:33
  • 1
    There are many reasons why people may not be able to update from one version of J! to another. "Manually" updating (i.e. overwriting an existing website with files extracted from an installation package) is not the way to resolve these issues. If people have problems updating J! then they should explain why they have such problems (e.g. "AJAX loading issues", "You already have the latest version installed", "No XML manifest file", etc.). My purpose in posting to this thread was to point out why "manually" updating is a non-solution.
    – sozzled
    Mar 6 at 5:08
  • Wow @sozzled! Thank you for posting on my question! What I've written here was inspired by what has been part of the official Joomla documentation for many years, even until 2019, which is after my question-answer here. Thank you for the update, though! It will be very useful to read what's the current suggestion of the Joomla team, when the Joomla updater fails. Feel free to post that, please. Mar 7 at 11:04
  • The article you refer to was sourced from the "Internet Wayback Machine"; the original article was removed from the official J! documentation website (see forum.joomla.org/viewtopic.php?f=303&t=992328 for a discussion on that matter). We have written on many occasions that there is no "manual" method for updating from one version of J! to another and that such approaches create problems. The recommended way to update J! is to use the Joomla! Update component. If people have problems with that approach they should work through those problems before trying anything else.
    – sozzled
    Mar 7 at 19:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.