PhotoAlbum Manual

What is it?

What's Needed

Getting Started

using PhotoAlbum

PhotoAlbum administrator

managing users

managing categories

adding photos one by one

editing photos

adding photos the fast way

exporting the database

importing the database

switching to mysql

It's unlikely this will be necessary as the built in default hsqldb database should be adequate. If your superb photos attract lots of viewers or you are running mysql anyway, you may want to switch. If you already built up a sizable database the export / import facility will be your friend.

You can prepare mysql by entering the commands below:-

The necessary tables will be created by the application when it's first run, but these are massively oversized.

You can tune the database (described below) once the tables have been created or insert the supplied empty database from the OS command line with
mysql -u photoalbum PhotoAlbum_prod < PhotoAlbum_mysql

Tuning mysql

Unless your running some other database that needs it, turn off Innodb. Edit my.cnf and uncomment (or add) the line skip-innodb. For reference this is how the default mysql database that grails creates can be tuned:-

switching to postgresql

Download a postgresql JDBC driver and put it in the PhotoAlbum/WEB-INF/lib directory.

The default authentication policy allows system users to access databases with their system passwords, whereas we need a non system user to authenticate. Make the pg_hba.conf file look like this (password authentication):-

# TYPE  DATABASE        USER            ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all             all                              password
# IPv4 local connections:
host    all             all             127.0.0.1/32     password
# IPv6 local connections:
host    all             all             ::1/128          password

and restart postgresql.

As the postgres user, create the user photoalbum with password photoalbum:-

createuser -P photoalbum
Enter password for new role: photoalbum
Enter it again: photoalbum
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) n

Then create the database:-

createdb -O photoalbum "PhotoAlbum_prod"

Insert the empty data base to avoid having oversized tables:-

psql -d "PhotoAlbum_prod" -U photoalbum < PhotoAlbum_postgres

and authenticate with the password photoalbum.

converting an existing database

In addition to exporting an existing hsqldb / mysql database and importing into postgres, the mysql2pgsql.perl program seems to reliably convert a mysql database, which can then be inserted in the same way as an empty database (above).