Upgrading from earlier versions

PostgreSQL

Execute the proper upgrade*.sql script from sql/.

MySQL

From 0.1.1 to 0.2

The following instructions give you the necessary information to upgrade your phpaga database under MySQL from phpaga 0.1.1 to phpaga 0.2.

Since phpaga 0.2 we use Pear::DB to abstract database access. Since MySQL does not support sequences directly (it has the 'autoincrement' feature), Pear needs a set of help tables that contain the sequence values.

  • Apply sql/upgrade_0.1.1-0.2.mysql and sql/phpaga_sequences.mysql:

                    $ mysql -uroot -p phpaga < sql/upgrade_0.1.1-0.2.mysql
                    $ mysql -uroot -p phpaga < sql/phpaga_sequences.mysql
                    

  • The user passwords need to be migrated from MySQL password() to md5 hashes, in order to have a common way to manage encrypted passwords on different rdmbs. You can use md5sum to generate md5 hashes.

    Example (under Debian GNU/Linux):

                    $ md5sum.textutils --string oldpassword
    
                    d5b5fffc89f961903fb3c9a173f1b667  "oldpassword"
    
                    mysql> UPDATE users SET usr_passwd = 'd5b5fffc89f961903fb3c9a173f1b667'
                    WHERE usr_login = '@YOUR_LOGIN@';
                    

    If you do not have md5sum.textutils you can create a small php script that contains the following lines:

                      
                               <?php
                               echo md5('@PASSWORD@');
                               ?>
                      
                    

    and either parse it via the command line php or via a php-enabled webserver and the output string will be the correct md5 value for your password.

From 0.2-rc1 to 0.2

In order to upgrade from phpaga 0.2-rc1 to 0.2 release simply apply sql/upgrade_0.2_rc1-0.2.mysql:

            
                     $ mysql -uroot -p phpaga < sql/upgrade_0.2_rc1-0.2.mysql
            
          

Migrating phpaga from MySql to PostgreSQL

Starting with version 0.2-rc1 phpaga features database abstraction through Pear::DB. As of version 0.2 the following rdbms are supported:

  • PostgreSQL

  • MySQL

If you want to migrate your phpaga data from MySQL to PostgreSQL you might find the following instructions of help.

  1. Create a mysqldump of phpaga containing just the data:

                % mysqldump -uphpaga -pyourdbpasswd -c -t phpaga > phpaga_data.sql
                

  2. Connect to the PostgreSQL phpaga database with pgsql using the phpaga db user:

                  % psql phpaga phpaga
                  phpaga=> \i phpaga_data.sql
                

    Check the output for errors.

  3. Set the sequences to the correct values:

                phpaga=> \i /path/to/phpaga/sql/phpaga_setseqvals.pgsql
                

This should be it. Please report any problems via the mailing list.