Gallery 2.0.4 comes with an important security patch that is recommended for all Gallery 2 installations. We advise that you upgrade to it as soon as possible.
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.
In order to upgrade, you need to figure out what version of Gallery2 you're currently using. 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. If you're running an official release it will say 2.0, 2.0.1, 2.0.2 or 2.0.3. If it has a + in it, like 2.0+ or 2.0.1+ then you've installed from a nightly snapshot.
Download the correct version of the upgrade file that matches the version of Gallery2 that you're using.
Your installed version | Update file |
---|---|
2.0 | 127K |
2.0.1 | 95K |
2.0.2 | 73K |
2.0.3 | 49K |
This file contains both the patch and all the changed files so that once you have it you can upgrade using either approach. Copy this file to your webserver and unpack it in your gallery2 directory. Depending on which version you're upgrading from, the file will contain some or all of the following files:
patch-core.txt | The necessary changes to the core module |
patch-zipcart.txt | The necessary changes to the zipcart module |
README.txt | Instructions (that tell you to come to this page) |
changed-files-core.zip | A zipfile containing all the changed files in the Gallery 2 core |
changed-files-zipcart.zip | A zipfile containing all the changed files in the zipcart module |
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.
There are four different ways you can update to the 2.0.4 files. They're all relatively easy to do, but you should choose the method that works best for your situation.
Note: In general, if you've extensively modified your Gallery 2 then it's a very good idea to use Gallery 2 from CVS and take the Updating via CVS approach.
Inside the zipfile are more zipfiles with names like "changed-files-xxx.zip". Each of these contains the changes for a specific module. Simply unzip thesee file inside your Gallery 2 directory and then run the upgrader 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 Unix you'd do this.
cd gallery2 unzip changed-files-core.zip unzip changed-files-zipcart.zip (if it's in the update, and you use zipcart)
If you're unsure, you can download a complete new copy of Gallery 2.0.4 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. If you're updating from 2.0.1 and you're using the zipcart module (look in your gallery2/modules directory or on Site Admin -> Modules) then you should download the either the full or the developer package.
The advantage to this approach is that it will preserve any modifications that you've made except in the highly unlikely event of a conflict between your modifications and the changes that we've made as part of this patch.
The patch file is very small, but in order to use it you must be on a system that has the "patch" utility. This is a pretty standard utility on Unix systems, and if you're on Windows you can get it as part of the Cygwin package. Solaris users should use gpatch (GNU patch, /usr/bin/gpatch on Solaris 10).
There are .txt files included in the upgrade file named something like "patch-xxx.txt" . All updates contain patch-core.txt. If you're updating from 2.0.1 or earlier the update will also contain patch-zipcart.txt. Copy them to your Gallery 2 directory and then do the following:
patch -p0 -s < patch-core.txt patch -p0 -s < patch-zipcart.txt (only if you have a modules/zipcart directory)
You should expect to see no output. Anything that is returned is an error. If you get an error you should contact us in the Gallery 2 forums and ask for help.
If you have Gallery 2 installed from CVS you can simply run:
cvs update -Pd
which will get you the latest code. This will also get you any new features that we've added since the 2.0 release. If you want to make sure that you stay close to 2.0, you can track the 2.0 branch by doing this:
cvs update -Pd -r BRANCH_2_0
That will get you only code that has changed since 2.0.
Note: Be very careful when you do this! If you've been updating from CVS regularly you may wind up downgrading if you go back to the 2.0 branch and that may cause you problems. Only do this if you know what you're doing.
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.