Gallery2:Upgrading - Gallery Codex
Personal tools


From Gallery Codex

Step by Step Instructions

Updating is quick and easy and can be done in a couple of minutes.

Make a backup

The upgrade process should be very safe. But just in case, it's a very good idea for you to make a backup. So before you perform this upgrade you should backup the database just in case. If something goes wrong you can always restore the database and try again. If you've made modifications to your copy of the Gallery 2 code, you should back up your changes also in case the update overwrites some of them.

Next: Identify your Gallery 2 version

Identify your Gallery 2 version

Browse to your Gallery 2 installation in your web browser, log in as an administrator, click the "Site Admin" link then click the "Maintenance" link. You'll be presented with a list of maintenance tasks. Next to the task marked System Information click the run now link then look for a line marked Gallery version.

Next: Review the Release Notes and Known Issues

Review the Release Notes and Known Issues

Before starting the upgrade, you should review the release notes of the latest Gallery 2 version and scan the known issues.

The requirements of Gallery 2 might change (e.g. the required PHP version) or there might be a documented upgrade problem for your specific setup.

Next: Upgrade the Application Files

Upgrade the Application Files

There are three ways to upgrade:

  1. Replace all files: Download a complete replacement for your Gallery 2. This is slower, but very reliable.
  2. Use an update file: Replace only what's changed since the major release. This option is only available for security & patch releases. If you've modified your Gallery 2 code, this technique can preserve your changes. It's faster than a complete replacement, but takes a little more know-how.
  3. Update from Subversion: This is the best approach if you've made changes to your Gallery 2 code. It's relatively fast and won't step on any changes you've made, but it requires a lot of know-how and is not available to most people.

Replace all files

Gallery2:Download#Packages Download a complete new copy of Gallery 2 and simply unpack it on top of your existing Gallery 2 install and then run the upgrader. This is a simple and thorough but slow method. Also, any modifications that you've made to Gallery 2 will be lost when you replace the files, with the exception of template changes made in local directories.


Next: Run the web based upgrader

Use an update file

First determine your exact Gallery 2.x.y version (e.g. Gallery 2.2.1).

Update files are only available for the following versions:

Update from Subversion

If you have Gallery 2 installed from Subversion you can simply run:

svn update

which will get you the latest code from the area you originally checked out. If you checked out BRANCH_2_3 then this will retrieve the latest 2.3.x version; if you checked out the trunk this will get the latest development code.

Next: Run the web based upgrader

Run the web based upgrader

Once your files have been updated, open up your Gallery 2 in your web browser and it will take you right to the upgrader automatically. Follow the instructions there.

On step 2 of the upgrader, the Gallery file integrity check should show Success. If there are missing/deleted/modified files listed here, you should make sure that they are files that you yourself have modified in your own copy. If it reports over a hundred missing files from the modules/core/test directory then verify that you did not accidentally install the developer zip of changed files over an install that was originally from the minimal, typical or full version. If you did that's ok! Just go back and get the right zip file and try again.


  • If you use a PHP accelerator / cache (e.g. Turk mmCache, Ioncube PHPA, eaccelerator, Zend Studio, etc.), flush (clear) the cache of the accelerator. Omitting this step can sometimes lead to errors during and after the upgrade process.
  • If you have not already, backup your Gallery before upgrading the core module!

Upon successful completion it will drop you back into your Gallery 2 install with the latest version and you're done.

About Upgrades

New Gallery 2 releases come with new and improved features and with bugfixes.

Major Releases

2.0 was the first official release of Gallery 2. Gallery 2.1 followed about half a year later, followed by 2.2, etc. These are major releases of Gallery which come with new and improved features and a lot of smaller and bigger bugfixes.

Please note that Gallery 2.3 is the last major release to be compatible with PHP 4 and PHP 5. Gallery 2.4 will only support PHP 5 and later. Related announcement: Gallery requiring PHP 5 by the first major release in 2008.

You should subscribe to the announcements mailing list to get notified about all important updates.

Security and Patch Releases

In case we announce a security vulnerability patch release, you should upgrade your installation as fast as possible to ensure that it is protected from all known vulnerabilities.

Security upgrades can be easily identified by the version number. All Gallery 2 version numbers follow the x.y.z scheme. 'x' is obviously always '2'. 'y' changes on major releases. And 'z' changes on security and patch releases.

We try to keep the number of security & patch releases as small as possible, usually only to address an important security vulnerability or if there was a very important bug that slipped through our thorough release testing and quality assurance.

This is why security releases only contain a very small set of changes confined to the very problem that needed to be addressed. You will not get other bugfixes and new features since the last major release when doing a security upgrade. But that also means that the number of files to upload is very small in this case. Security upgrades are very quick and easy.

Also note that the latest stable release always includes all security fixes and patches.

If you have already a specific Gallery 2 version and need to install a security patch, please see: Using an update file

Upgrading To Nightly Snapshots And Development Versions

Gallery 2 is managed in a central source code repository and we refer to the current state of this repository as the 'development version' of Gallery 2. Gallery developers strive to keep this development version as stable as possible.

A nightly snapshot is a packaged copy of the current development version of Gallery which is at most 24 hours old.

Although some quality assurance testing is done permanently, there is a reason why we recommend the latest official release and not the development version to our users. The latest development version might have new features you're anxious to use on your website, but much more testing, auditing and quality assurance is done for official releases than during development.

Nevertheless, there are people that appreciate the high quality of the the development version and actually use it on their own production server. And sometimes, we will recommend the nightly snapshot to specific users because they might suffer from a specific problem that has been addressed since the last official release.

Upgrading from and to nightly snapshots and development versions is the same as with official releases.

Note: You can also use the Pre-Installer to upgrade to a nightly snapshot.

Upgrading Multisites

See: How to Upgrade a Multisite

Upgrading an Integrated Gallery

In case your Gallery is integrated in another application (CMS, blog, portal, forum, ...), you first need to ensure that the new Gallery version is compatible with the other application. Also, you should check if there is an updated integration available for your specific application. Best is you consult the project website of the specific integration.

Other than that, upgrading is the same as for a standalone / normal Gallery 2 installation.