Composr Tutorial: Performing an upgrade

Written by Chris Graham (ocProducts)
This tutorial will give background information for this process of upgrading Composr. The Composr upgrader does step you through the process, but further information will be given here so that you may gain a further understanding.


Types of upgrade

When the developers make a release they will state whether they recommend users upgrade to it. If they have corrected a security issue, or a major bug (such as one that causes data loss), they are likely to strongly recommend upgrade. You can see the fixes included in a release by looking at the bugs database for the release before it.

Upgrades may be roughly categorised under:
  • patch releases – these are likely to involve bug fixes, with very few, if any new features. Any new features would have been implemented solely to provide important functionality that was obviously missing. Patch releases are very easy to upgrade to
  • or, feature releases – these are likely to include many new features; the quantity of new features will depend on the difference in version numbers between releases. Minor releases are usually easy to upgrade to
  • or, major releases – these are likely to involve many architectural changes, as well as new features; major releases are less common, as they need to perform additional testing for them which takes a long length of time – they therefore try to avoid architectural changes other than in large batches

It is recommended that you do not 'jump over' major releases (e.g. v2 to v4, jumping over v3) that you do not feel you need (or did not have time to upgrade to), as the chance is higher of an upgrade process bug being present in unusual upgrade jumps. In theory, it should work without issue, as the process has been designed very carefully, but in practice, it is very easy for a very minor glitch to cause major problems that need manual resolution: in such an event, the developers would fix the problem, either directly, or by mass provision of a script, but it would be an inconvenience and could take some time.

Some words of caution

The developers cannot make any guarantees about the speed of which any new bugs might be patched, for any upgrade. It is your own responsibility to make and test a full website backup (files and database) before you upgrade, for use in the unlikely event of you wanting to revert your upgrade.
Some users may wish to test upgrades (and pre-fix any theme compatibility problems that could occur) on a staging/clone site (a private mirror of their live site).

Special note: multi-site-networks

If you are using Conversr on a M.S.N. and upgrading to a new major release then you will need to upgrade all the sites together, starting with the one that hosts the forums.

Special note: upgrading third-party forums

If you are using a third-party forum and upgrading that software, be sure to check that the Composr forum driver you are using is compatible with the new version. This is usually only an issue with major new releases of third-party software. If you need a new/upgraded forum driver, professional developers are available for such work.

Things to check in feature/major releases

Be aware that a number of things can change significantly across releases. Make sure you have a good understanding of how the following things may affect you, before making 'the jump':
  • Template and CSS structure could change considerably. Files may be renamed, reorganised internally, or things may just be completely rearchitected.
  • Occasionally features may be deprecated.
  • New features will be added, and that could possibly interfere with highly tuned layouts or site flows.
  • Minimum requirements may have changed, for example a newer version of PHP may be required as a baseline.
  • Non-bundled addons may no longer function.
At the same time, bear in mind that fixes to security holes are not always back-ported to older releases, especially if a newer feature/major version has been out for a while. So ideally you should not stick around on old versions too long. If you want to avoid upgrading but also need to keep your site secure, you should strongly consider getting a developers support (such as ocProducts) so that you can be kept up-to-date manually.

The upgrade process

Image

The upgrader

The upgrader

(Click to enlarge)

Image

Logging into the upgrader

Logging into the upgrader

(Click to enlarge)

The upgrade process involves a number of stages (the upgrader will step you through this)…

Pre-steps:
  1. get to the upgrader, either via the upgrade link from the top-right of the Admin Zone dashboard, or going to http://yourbaseurl/upgrader.php
  2. log in to the upgrader using your master password (the one you set when you installed, different to your admin login)

Steps:
  1. taking a full backup (just in case a problem occurs) – better safe than sorry. This is also useful in case you overwrite files that you have edited: either due to these files being in locations with no override support, or due to changes being made without using the proper override mechanism
  2. closing your website
    • the upgrader will make it easy for you to close your site using the Composr closed-site feature
    • however, for non-patch upgrades your website may return errors until the full upgrade process is complete, so you may wish to place your own closed.html file on the server that shows a standalone closed-site screen. Composr will redirect to that file for all page requests for as long as it exists on your server (so it does not need to load its database or templating system)
  3. transferring new/updated files (this will copy your customised upgrade file between https://compo.sr and your server, and then extract it)
    • if your server's connection to the https://compo.sr server is slow, you could download the TAR file yourself, upload it to your own server, and then use that copy's URL in step 3
    • on modern server environments the extraction happens in a separated framed process, so that if timeouts occur it can't leave your website in an inconsistent state
    • if in the unlikely event that you do end up with an inconsistent state then you can download the TAR file yourself, extract it manually, and then continue; this is not ideal but the file integrity check should help remove files from uninstalled bundled addons that don't belong
  4. resolve file integrity issues
    • if you have made any Composr overrides in place you may need to change these overrides to be consistent with Composr's latest structure; or if the overrides came from addons, you may need to overwrite the addon(s) with a newer version
    • the above guidance applies to totally new code also, such as new modules from non-bundled addons
    • resolving any conflicts with templates, as necessary (for example, if there was a change in the verbatim version of a template, and the upgraded website had also changed that template, then changes might [depending on importance] need to be incorporated manually)
    • removing any files from previous versions of Composr that are no longer required
    • removing any files relating to bundled addons that you have previously uninstalled
  5. upgrading your database; this is the most key step, which upgrades all modules and blocks, as well as doing some cross-system updates, and updating Conversr – if any errors happen they'll be displayed and you should note them down and report them, but Composr will generally try and continue anyway if there are minor errors happening
  6. performing an automatic theme upgrade (if available for the version jump you're doing – we usually have this disabled because it is not something we can support well currently; instead we recommend using https://compo.sr/themeing-changes.htm to help you do it manually)
  7. clearing caches
  8. re-opening your website

Browser cache

Often browsers will cache CSS and JavaScript files, even when changed on the server. Usually completely restarting the browser will make it recheck cache times. If you get JavaScript errors after upgrading, chances are fair that you need to empty your browser cache.

Assistance

Upgrading is inherently complex, as it is close to programming in the sense that low-level changes are being made to the structure of the website. This is unfortunate but inevitable, and due to Composr's openly configurable and overridable (at the code level) nature, the developers would have an extremely hard time trying to automate the process beyond what the upgrade system (the stage launched by running http://yourbaseurl/upgrader.php) already does.

If you require assistance for an upgrade, professional developers may be able to help.

The integrity checker

Image

Results

Results

(Click to enlarge)

Image

Finding the integrity checker

Finding the integrity checker

(Click to enlarge)

This section contains standalone details on using the integrity checker.

Composr comes with a built-in "integrity checker" which can be used to repair a corrupted copy of Composr. Integrity checker is a part of the upgrader tool. The integrity checker can be used to find outdated and corrupt files in the Composr system. You can use this tool at any point, regardless of whether you have recently upgraded or not.

You must provide the master password to access the Composr upgrade tool.

The integrity checker is placed in the "Step 4" of the table under the "Upgrade steps" section in upgrader tools page.

The integrity checker will display the following kinds of file (if any):
  • Files that are actually missing and need uploading:
    • Missing the original, no override ("These files are actually missing and need uploading")
    • Missing the original, has an override ("The following original files to these overridden files are actually missing")
  • Overrides blocking original files ("The following files have been superseded by new versions")
  • Modified files:
    • Newer than the original ("These files do not match the ones bundled with your version, but claim to be newer")
    • Older than the original ("These files are outdated")
    • Older than the original, and with an override blocking the original ("The following non-overridden files are outdated")
  • Files that maybe shouldn't be there:
    • Alien files (unrecognised files)
    • Files from non-installed addons
    • Files that have since been moved

If you want to prove to yourself how it works, create a random php file named testfile.php in the sources directory of Composr and run the integrity checker again. Now it will list the new testfile.php file in the results.

This is very useful for upgrading because it helps identify old files that need removing. Generally though it is useful to make sure unexpected files don't lay around within the system causing potential problems.

The integrity checker has the ability to get rid of the alien files. Check (tick) the checkbox next to the file name and press the "Automatically handle those ticked (checked) – delete/move as needed" button placed below the list of files. The selected files will be deleted or in some rare cases moved.

Obviously you should be careful deleting files, as there may be legitimate reasons you have put alien files there. The upgrader is smart enough to recognise files from old versions and automatically tick (check) those, leaving the ones totally unrecognised unticked (unchecked).

Upgrade packages

Generally you upgrade using the package generated from the news announcement of the new version. A custom package for the version you are upgrading from will be generated. It is not safe to extract these packages manually because they contain the files for all non-bundled addons, regardless of what you still have installed or not. You do not want to get files from non-installed addons back into your system, it can cause many issues. When you install the package from within the upgrader it is smart enough to know what to extract, verses what to package into the non-bundled addon TARs that were archived to disk when you uninstalled those addons.

In the file transfer step of the upgrader you can see there is also a link to generate a custom upgrader specifically for your site. This link is more customised than the above because the package is generated with knowledge of what bundled addons you have installed, and thus it is possible to manually extract it safely. The package also contains a full set of non-bundled addon TARs so that you know anything you reinstall will be for the version you are currently running, not an older version.

We may very rarely provide something called an "omni-upgrader", which can be used to upgrade from any version. We did this when we switched from ocPortal to Composr, as our entire infrastructure got cycled over, breaking the normal upgrade workflow.

Auxiliary features

There are some extra features in the upgrader that aren't a part of the normal flow:
  • Checking/fixing necessary file permissions
  • Checking/fixing excessive file permissions
  • Delete all files from a specific addon
  • Opening up the site in Safe Mode
  • Clearing caches (okay, this is a part of the normal flow, but it is very useful even if not doing an upgrade because you don't need a working Admin Zone to do it)

Troubleshooting

Timeouts

If the upgrader times out trying to download the upgrade package then try:
  1. manually downloading it to your machine
  2. uploading it to your server, to create a server-held URL
  3. substituting your server's URL with the autogenerated one

Other transfer/extraction issues

In the "Transfer across new/updated files" step there's a "generate a personalised manual upgrader" link. This will create an upgrade TAR file that is safe to manually extract onto your server.

Concepts

upgrader.php
The script that manages the upgrading process
Integrity checker
Tool to find unexpected files in the Composr installation

See also


Feedback

Please rate this tutorial:

Have a suggestion? Report an issue on the tracker.