From Gallery Codex
Gallery 3 is very easy to upgrade. You just need to get the latest copy of the code and run the upgrader, which does everything in a single step. The whole process can take you less than a minute and only one click in your web browser.
Note: You cannot upgrade an alpha release of Gallery 3. You must have a beta release already installed to follow these upgrade instructions.
Upgrading from Beta 3 or older - Special Instructions
Due to some changes after Beta 3 was released, if you are upgrading from B3 or older and using zip or tar downloads, either from GitHub or from Gallery's main site, then you need to make sure no old code remains behind. See ticket #882 for the gritty, technical details.
- Log in to your Gallery 3 as an admin user. If you do this before you replace your code, it'll save you a step in authentication.
- Extract the contents of the zip or tar file into a different directory. Do not overwrite your existing installation.
- Move the "var" directory from your old gallery3 directory into your new gallery3 directory from step 2.
- Rename or delete your old gallery3 directory.
- Rename your new gallery3 from step 2 to what your old gallery3 directory was named.
- Any changes you've made to themes, or any other files will be gone and you'll need to redo those.
- Now there are two ways to upgrade:
- Using your web browser
- Open the upgrader in your web browser by browsing to http://example.com/gallery3/index.php/upgrader where you replace example.com/gallery3 with your real url. If you forgot to log in as admin, it'll ask you to create a temporary file just to prove that you're an admin.
- Read the text there and click the Upgrade all link
- On the command line
- cd gallery3
- php index.php upgrade
Steps to upgrade for everyone else
- Log in to your Gallery 3 as an admin user. If you do this before you replace your code, it'll save you a step in authentication.
- Download the new code. You can get official releases or you can download an the latest development source. The development source is the most up-to-date version. We try to keep this stable, but sometimes little gotcha's slip in.
- If this is your first time, you might want to read the unpacking tips below.
- Now there are two ways to upgrade:
- Using your web browser
- Open the upgrader in your web browser by browsing to http://example.com/gallery3/index.php/upgrader where you replace example.com/gallery3 with your real url. If you forgot to log in as admin, it'll ask you to create a temporary file just to prove that you're an admin.
- Read the text there and click the Upgrade all link
- On the command line
- cd gallery3
- php index.php upgrade
Tips for unpacking the code
- If you're using an official release, it unpacks into a directory called gallery3. So if you've named your directory gallery3 also, you can just unpack the new version over the old version, replacing all the files. If you named your directory something else, you can unpack the new zip file somewhere else and just move the "var" directory from the old install to the new one, then rename your directories until they're right for you.
- If you're using an experimental version, you'll see that it unpacks into a directory with a long and weird name. That name tells you exactly which version you downloaded and while that's useful for discussing in the forums, it's probably not relevant to you. So just move the "var" directory over from the old install and rename directories until you're happy. This ensures that there is no old files from your previous install that will cause issues.
Note: Ensure that the "var" directory has the necessary write permissions for the web server
Upgrading from G2 to G3
This should have its own page and more details but it's a start:
There's a module for g3 which imports your g2 albums / users / comments.
the process is like this:
- backup your g2 (data folder and database)
- put g3 on your server, e.g. to a parallel folder to your g2.
- install g3
- enable the comments module and the g2 import module in g3
- configure g3's g2 import module and run the import process.
- rename your g2 folder to something else (e.g. from "gallery" to "gallery_old") - optional
- rename your g3 folder to what the g2 folder used to be (e.g. "gallery3" to "gallery") - optional
- add the mod_rewrite rules from g3's g2_import module page to your .htaccess file to ensure that the g2 urls continue to work - optional
- delete your g2 folder ("gallery_old"), it's no longer needed. you can delete your g2 database as well. (but keep your backups) - optional