1. MagicESP
  2. Ubuntu Server 22.04
  3. PostgreSQL
  4. Upgrade from PostgreSQL 8.4 on Ubuntu 12.04 to PostgreSQL 9.1 on Ubuntu 14.04

Upgrade from PostgreSQL 8.4 on Ubuntu 12.04 to PostgreSQL 9.1 on Ubuntu 14.04

sudo apt-get install postgresql-9.1
sudo /etc/init.d/postgresql stop
 
sudo ln -s /etc/postgresql/8.4/main/postgresql.conf /var/lib/postgresql/8.4/main/postgresql.conf
sudo ln -s /etc/postgresql/9.1/main/postgresql.conf /var/lib/postgresql/9.1/main/postgresql.conf
 
cd /tmp
sudo -u postgres /usr/lib/postgresql/9.1/bin/pg_upgrade \
  --old-datadir=/var/lib/postgresql/8.4/main \
  --new-datadir=/var/lib/postgresql/9.1/main \
  --old-bindir=/usr/lib/postgresql/8.4/bin \
  --new-bindir=/usr/lib/postgresql/9.1/bin \
  --old-port=5432 \
  --new-port=5433
 
sudo apt-get remove postgresql-8.4
 
sudo vim /etc/postgresql/9.1/main/postgresql.conf
Change listen port to 5432
sudo /etc/init.d/postgresql restart