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

From Vincent Veyron
Subject Re: upgrading from debian 6 to 7--do in place or wipe-and-install?
Date
Msg-id 20140329180326.2cef2ee3c97292bdcbe371ae@wanadoo.fr
Whole thread Raw
In response to upgrading from debian 6 to 7--do in place or wipe-and-install?  (Kevin Goess <kgoess@bepress.com>)
List pgsql-general
On Fri, 28 Mar 2014 10:35:20 -0700
Kevin Goess <kgoess@bepress.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::RequestRecApache2::SubRequest Apache2::Response Apache2::Filter Apache2::Cookie Apache2::Connection APR::Table
CGI::CookieURI::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


pgsql-general by date:

Previous
From: Willy-Bas Loos
Date:
Subject: Re: [ADMIN]openvz and shared memory trouble
Next
From: Adrian Klaver
Date:
Subject: Re: [ADMIN]openvz and shared memory trouble