Gallery2:Upgrading to 2.2.x - Gallery Codex
Personal tools

Gallery2:Upgrading to 2.2.x

From Gallery Codex

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 Gallery2 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: Upgrade

Upgrade

There are three ways to upgrade:

  1. Replace all files: Download a complete replacement for your Gallery2. This is slower, but very reliable.
  2. Use an update file: Replace only what's changed since the 2.2 /2.2.x release. This only works if you're using the 2.2 or a later 2.2.x release. If you've modified your Gallery2 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 Gallery2 code. It's relatively fast and won't step on any changes you've made, but it requires a lot of know-how.

Note on files in modules/ and themes/ (other than modules/core): If you're using plugins from the experimental repository of downloadable plugins, you should upgrade it through downloadable plugins as well. The version included in 2.2.x is probably incompatible with or older than the version of the plugin that you're already using.

Use an update file

First determine your exact Gallery 2.2.x version.

This file contains all the changed files. Copy this file to your webserver and unpack it in your gallery2 directory. Once unpacked, you will have the following files:

Remember that when you're done with the update, you should delete these files! Leaving them around won't hurt you, and won't be a security risk but they don't help either. Also remember that you don't need all these files. You only need to extract the files for the modules / themes that you have installed.

Next: Replace only changed files

Replace only changed files

Inside the zipfile are more zipfiles with names like "changed-files-xxx.zip". Each of these contains the changes for a specific module or theme. Simply unzip these files inside your Gallery 2 directory and then run the upgrade wizard and follow the instructions. This is reasonably fast because there are very few changed files however if you've modified any of the files that are replaced, your modifications will be lost. On Linux/Unix you'd do this:

cd gallery2
unzip changed-files-core.zip
unzip changed-files-webdav.zip    (if you use the webdav module)
...

If you don't have command line access to the server where Gallery runs, you need to extract the zipfiles on your computer and then upload the extracted files e.g. via FTP to your server.

  1. Extract the zipfile update-[your current version]-to-2.2.6.zip. Result: The above mentioned list of module and theme specific zipfiles like "changed-files-core.zip"
  2. Extract the zipfile "changed-files-core.zip" and other changed-files-[module or theme name].zip zipfiles for all modules and themes that you use in your Gallery. Result: A list of extracted folders and files that you need to upload to your Gallery. This includes "modules/core/module.inc", "modules/core/MANIFEST", etc.
  3. Upload these files to your web server (e.g. using an FTP client). In this process you will overwrite existing files on your server. E.g. "modules/core/module.inc" from your desktop must replace the same file at the same location on your server.

Note: If you're used the preinstaller to install Gallery 2, you'll need first need to open your Gallery 2 folder for changes. See: How to make the Gallery 2 folder writable?

Next: Run_the_web_based_upgrader

Replace all files

Download a complete new copy of Gallery 2.2.6 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.

Note: Gallery 2 packages come in 4 flavors (typical, minimal, full, and developer). You should try to make sure you download the same package as you did before.

Next: Run_the_web_based_upgrader

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_2 then this will retrieve the latest 2.2.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.

Note: If you're updating from 2.0.1 or earlier you may get an integrity error warning that the docs/LOCALIZING file is obsolete. You can delete this file from your installation safely.

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