Skip to content

Instantly share code, notes, and snippets.

@uggedal
Created September 25, 2012 11:07
Show Gist options
  • Save uggedal/3781177 to your computer and use it in GitHub Desktop.
Save uggedal/3781177 to your computer and use it in GitHub Desktop.
Upgrade postgresql from 9.1 to 9.2 on Arch Linux
systemctl stop postgresql && pacman -Syu --noconfirm && su - postgres -c 'mv /var/lib/postgres/data /var/lib/postgres/olddata' && su - postgres -c "initdb --locale en_US.UTF-8 -D '/var/lib/postgres/data'" && systemctl start postgresql.service && systemctl stop postgresql.service && pacman -S postgresql-old-upgrade --noconfirm && su - postgres -c 'pg_upgrade -d /var/lib/postgres/olddata/ -D /var/lib/postgres/data/ -b /opt/pgsql-9.1/bin/ -B /usr/bin/' && /var/lib/postgres/delete_old_cluster.sh && rm /var/lib/postgres/delete_old_cluster.sh && /var/lib/postgres/analyze_new_cluster.sh && systemctl start postgresql.service && pacman -Rs postgresql-old-upgrade --noconfirm
@Skatox
Copy link

Skatox commented Feb 22, 2016

Thanks, your script helped me a lot to migrate 9.4 to 9.5 in archlinux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment