The most reliable way to upgrade Gallery2 is to do a complete replacement.
To ensure a safer upgrade, it’s recommended that you deactivate or even uninstall all the plugins installed, and change the theme back to default theme of Gallery2 to Matrix.
Download and extract the latest version of Gallery2.
$ cd /var/www/
$ wget http://downloads.sourceforge.net/gallery/gallery-2.2.5-minimal.tar.gz
$ tar -zxvf gallery-2.2.5-minimal.tar.gz
I like to use symbolic links to help me easily replace older version with newer one.
$ mv gallery2 gallery-2.2.5
$ ln -s gallery-2.2.5 gallery2
Copy the existing g2data directory to the new Gallery2 directory e.g.
$ cp -R ./gallery-2.2.4/g2data_e76ab32e8b ./gallery-2.2.5
Run the install script by pointing your browser to the base url of your website (e.g http://gallery.vincentkong.com), which will bring you through an installation wizard to setup Gallery.
When the Storage Setup is reached, Gallery will ask to specific a directory g2data where all the images will be stored. Enter the same directory which was just copied previously. e.g. /var/www/gallery-2.2.5/g2data_e76ab32e8b
When the Database Setup is reached. Click on the “Reuse Existing Tables” button.
When the Version Check is reached by the installer it will bring you to the Gallery Upgrader script, where you continue with the Upgrade wizard.
In the Upgrading the Gallery Core Module it’s recommended to back the exist database before continuing. e.g.
$ mysqldump -u username -p gallery_database > gallery_database.sql
The Upgrade Plugins is the final step in the upgrade process.














