Upgrading PostgreSQL from 8.3 to 8.4

Steps to Upgrade PostgreSQL in Ubuntu:

  1. Stop cron and other applications that using PostgreSQL.

    # /etc/init.d/cron stop
    # /etc/init.d/apache2 stop
    # /etc/init.d/jabberd2 stop
    # /etc/init.d/tinyerp-server stop
  2. Backup
    $ sudo su
    # su postgres
    $ pg_dumpall > /var/lib/postgresql/all.sql
    $ exit
  3. Install the latest PostgreSQL version

    # apt-get install postgresql-8.4
    ..
    Configuring postgresql.conf to use port 5433…Installer will detect the previous version, if exist than the new one will use port 5433.
  4. Restore to new version

    # su postgres
    $ /usr/lib/postgresql/8.4/bin/psql template1 -f /var/lib/postgresql/all.sql -p 5433
    $ exit
  5. Remove the previous version

    # apt-get remove postgresql-8.3
    # apt-get remove postgresql-client-8.3
  6. Change port 5433 to 5432 in /etc/postgresql/8.4/main/postgresql.conf:

    port = 5432
    Don’t forget to set other configuration, such:

    listen_addresses = '*'
    and access rules in /etc/postgresql/8.4/main/pg_hba.conf.
  7. Restart your postgreSQL

    # /etc/init.d/postgresql-8.4 restart
  8. Activate cron and other applications, make sure everything is OK.

    # /etc/init.d/cron start
    # /etc/init.d/apache2 start
    # /etc/init.d/jabberd2 start
    # /etc/init.d/tinyerp-server start
Tags: , ,

Leave a Reply