Since the packages transported via HTTPS, you need to have the right transport method installed for APT:
apt-get install apt-transport-https
Add the repository containing the gallery 3 package:
echo 'deb https://people.debian.org/~schultmc/debian unstable/ deb-src https://people.debian.org/~schultmc/debian unstable/' > /etc/apt/sources.list.d/schultmc.list
Import the repository key, update your sources and install the package:
apt-key adv --keyserver keyring.debian.org --recv-keys 9EC002FE1C9CA517 apt-get update apt-get upgrade apt-get install gallery3
The configuration dialog will ask you if it should restart your Apache server.
If the Apache server did not start:
service apache2 start
You should now be able to access the fresh Gallery 3 installation under
http(s)://<hostname or ip>/gallery3
If you want to change the re-wirte base there are a bunch of
.htaccess files in the Debian installation that need to be touched.
The following command changes the re-write base to the site-root:
find /var/lib/gallery3/ -name '.htaccess' | xargs -n 1 sed -i 's/RewriteRule .* \/gallery3/RewriteRule (.*) /'
In Gallery2 regenerate the thumbnails to make sure they are all correct:
Depending on the size of your gallery that may take a some minutes.
Switch your Gallery3 to maintenance mode:
Configure the importer module in Gallery3:
The import will run very long for a big collection of photos - be patient!
If the import stops, you check the in-app log via the web GUI and resume it.
Note that Gallery3 has a intentionally limited set of supported media formats. For example it refuses to import BMP files.
Note that the standard import only works if Gallery2 and Gallery3 are installed on the same machine. So if you want to migrate from 2 to 3 while switching to a new server, I recommend the following procedure:
When tried to install Gallery2 and Gallery3 in parallel on my Debian 6 server, the configuration script enabled
modphp4 which was not installed since PHP5 was there. Disabling the module solved the problem:
Generate a dump of the
gallery3 database on the source machine:
mysqldump -u root -p --databases gallery3 > /tmp/gallery3_database_dump.sql
Transfer the dump to the destination machine (e.g. via
On the destination server restore the database from the dump:
mysql -u root -p < /tmp/gallery3_database_dump.sql
Make sure the database user
gallery3 has the right permissions. In MySQL type:
GRANT SELECT, INSERT, LOCK TABLES, UPDATE, DELETE, ALTER ON gallery3.* TO gallery3@localhost IDENTIFIED BY '<password>'; FLUSH privileges;
scp -rp /usr/share/gallery3/var <destination host>:/usr/share/gallery3
Check if the contents of the file
/usr/share/gallery3/var/database.php match the new server! I ended up with a segmentation fault because the
gallery3 MySQL user did not have access to the database.