Re: upgrading from debian 6 to 7--do in place or wipe-and-install?

From: Vincent Veyron <vv(dot)lists(at)wanadoo(dot)fr>
To: Kevin Goess <kgoess(at)bepress(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: upgrading from debian 6 to 7--do in place or wipe-and-install?
Date: 2014-03-29 17:03:26
Message-ID: 20140329180326.2cef2ee3c97292bdcbe371ae@wanadoo.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 28 Mar 2014 10:35:20 -0700
Kevin Goess <kgoess(at)bepress(dot)com> wrote:
>
> Does anybody have any experience with upgrading in-place? Are there any
> recommendations for one or the other?

It works well if you pg_dumpall, remove postgres, upgrade debian, then reinstall postgres and restore from dumpall.

Remember to do 'upgrade-grub' before rebooting, so that the new kernel's parameters are loaded (if you use grub2)

I followed the instructions on this page : http://www.howtoforge.com/how-to-upgrade-debian-squeeze-to-wheezy

Below are the notes I took while upgrading my server. I use a LAMP stack made of postgresql, apache and mod_perl.

#
#upgrade server to new debian stable (Squeeze -> Wheezy)
#

#dump the dbs
cd /tmp
su postgres
pg_dumpall > 8.4.out

#remove old pg
apt-get purge postgresql-8.4 postgresql-client-8.4 postgresql-plperl-8.4

#mettre à jour
apt-get update
apt-get upgrade
apt-get dist-upgrade

#no packages must be on hold
dpkg --audit
dpkg --get-selections | grep hold

# Press g and the list shows which packages need your attention. Fix any packages in the action list, until the message says:
# No packages are scheduled to be installed, removed or upgraded
# Only then you are done and ready to pass this point.
aptitude

#edit /etc/apt/sources.list
sed -i 's/squeeze/wheezy/g' /etc/apt/sources.list

#using this one now
deb http://ftp.fr.debian.org/debian/ wheezy main contrib non-free

#instructions : http://www.debian.org/security/
deb http://security.debian.org/ wheezy/updates main contrib non-free

#launch actual upgrade
apt-get update
apt-get upgrade
apt-get dist-upgrade

#restore conf files
logrotate.d/apache
apache2.conf

#reinstall perl modules
cpan Apache::DBI DBD::Pg Apache::Session Apache::Session::Postgres Apache2::Request Apache2::RequestIO Apache2::RequestRec Apache2::SubRequest Apache2::Response Apache2::Filter Apache2::Cookie Apache2::Connection APR::Table CGI::Cookie URI::Escape DBD::SQLite

#upgrade postgres
apt-get install postgresql postgresql-client postgresql-plperl-9.1 postgresql-doc

#comment ssl=true in /etc/postgresql/9.1/main/apache2.conf
#edit pg_hba.conf
#local all all peer
local all all trust

#vérifier que ça tourne
psql -V

#restore from dumpall
psql -f 8.4.out postgres

#run update-grub
#reboot

--
Regards, Vincent Veyron

http://libremen.com/
Legal case, contract and insurance claim management software

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-03-29 17:17:26 Re: [ADMIN]openvz and shared memory trouble
Previous Message Willy-Bas Loos 2014-03-29 15:19:02 Re: [GENERAL] openvz and shared memory trouble