Обсуждение: help... lost database after upgrade from 9.0 to 9.1

Поиск
Список
Период
Сортировка

help... lost database after upgrade from 9.0 to 9.1

От
Bruno Boettcher
Дата:
Hello!

just made a stupid move... upgraded a working system.... and without
checking if the backup was ok....

so i end up with a debian system having upgraded to 9,1 without
converting the database, and a scrambled backup which is totally
unusable....

i tried to start the old tree with
pg_ctlcluster 9.0 main start
Error: could not exec   start -D /var/lib/postgresql/9.0/main -l /var/log/postgresql/postgresql-9.0-main.log -s -o  -c
config_file="/etc/postgresql/9.0/main/postgresql.conf":  


so i tried to copy the old 9.0 tree to a machine with a still working 9,0
postgres, but it stops with
Starting PostgreSQL 9.0 database server: mainError: could not exec
/usr/lib/postgresql/9.0/bin/pg_ctl /usr/lib/postgresql/9.0/bin/pg_ctl
start -D /var/lib/postgresql/9.0/main -l
/var/log/postgresql/postgresql-9.0-main.log -s -o -c
config_file="/etc/postgresql/9.0/main/postgresql.conf" : ... failed!
 failed!


 so what can i do to extract the data of that tree and feed it into the
 9.1 tree?

 thanks in avance!
--
ciao bboett
==============================================================
bboett@adlp.org
http://inforezo.u-strasbg.fr/~bboett/
===============================================================

Re: help... lost database after upgrade from 9.0 to 9.1

От
Adrian Klaver
Дата:
On Wednesday, January 04, 2012 6:50:25 am Bruno Boettcher wrote:
> Hello!
>
> just made a stupid move... upgraded a working system.... and without
> checking if the backup was ok....
>
> so i end up with a debian system having upgraded to 9,1 without
> converting the database, and a scrambled backup which is totally
> unusable....

Define scrambled backup.

>
> i tried to start the old tree with
> pg_ctlcluster 9.0 main start
> Error: could not exec   start -D /var/lib/postgresql/9.0/main -l
> /var/log/postgresql/postgresql-9.0-main.log -s -o  -c
> config_file="" :

On original machine verify that the locations and files in above command exist:
/var/lib/postgresql/9.0/main
/var/log/postgresql/postgresql-9.0-main.log
/etc/postgresql/9.0/main/postgresql.conf


>
>
> so i tried to copy the old 9.0 tree to a machine with a still working 9,0
> postgres, but it stops with
> Starting PostgreSQL 9.0 database server: mainError: could not exec
> /usr/lib/postgresql/9.0/bin/pg_ctl /usr/lib/postgresql/9.0/bin/pg_ctl
> start -D /var/lib/postgresql/9.0/main -l
> /var/log/postgresql/postgresql-9.0-main.log -s -o -c
> config_file="/etc/postgresql/9.0/main/postgresql.conf" : ... failed!
>  failed!

This is more of the same as above. For now lets concentrate on the original
install.

>
>
>  so what can i do to extract the data of that tree and feed it into the
>  9.1 tree?

Get the 9.0 server running.

>
>  thanks in avance!

--
Adrian Klaver
adrian.klaver@gmail.com

Re: help... lost database after upgrade from 9.0 to 9.1

От
Adrian Klaver
Дата:
On Wednesday, January 04, 2012 9:46:42 am you wrote:
> On Wed, Jan 04, 2012 at 07:41:32AM -0800, Adrian Klaver wrote:
> Hello!
>
> > Define scrambled backup.

I am CCing list so more eyes can see this.

>
> well.... disks on both side had block loss, without me noticing....
> so the backups were on the wrong partitions, and most of them are now
> part of lost+found if not lost completely...
>
> my luck that boths disks gave up more or less, at the same time, and
> more or less silently....

Alright, so really scrambled.

>
> > On original machine verify that the locations and files in above command
> > exist: /var/lib/postgresql/9.0/main
> > /var/log/postgresql/postgresql-9.0-main.log
> > /etc/postgresql/9.0/main/postgresql.conf
>
> all three ok!

So when you are running pg_ctlcluster 9.0 main start what user are you running
as?

Have you tried to directly start the 9.0 cluster as the postgres user?:

usr/lib/postgresql/9.0/bin/pg_ctl /usr/lib/postgresql/9.0/bin/pg_ctl start  -D\
/var/lib/postgresql/9.0/main\
 -l /var/log/postgresql/postgresql-9.0-main.log -s -o -c\
config_file="/etc/postgresql/9.0/main/postgresql.conf"


>
> > Get the 9.0 server running.
>
> heh :D
> that's what i didn't manage to do....

--
Adrian Klaver
adrian.klaver@gmail.com

Re: help... lost database after upgrade from 9.0 to 9.1

От
Radosław Smogura
Дата:
On Wed, 4 Jan 2012 15:50:25 +0100, Bruno Boettcher wrote:
> Hello!
>
> just made a stupid move... upgraded a working system.... and without
> checking if the backup was ok....
>
> so i end up with a debian system having upgraded to 9,1 without
> converting the database, and a scrambled backup which is totally
> unusable....
>
> i tried to start the old tree with
> pg_ctlcluster 9.0 main start
> Error: could not exec   start -D /var/lib/postgresql/9.0/main -l
> /var/log/postgresql/postgresql-9.0-main.log -s -o  -c
> config_file="/etc/postgresql/9.0/main/postgresql.conf" :
>
>
> so i tried to copy the old 9.0 tree to a machine with a still working
> 9,0
> postgres, but it stops with
> Starting PostgreSQL 9.0 database server: mainError: could not exec
> /usr/lib/postgresql/9.0/bin/pg_ctl /usr/lib/postgresql/9.0/bin/pg_ctl
> start -D /var/lib/postgresql/9.0/main -l
> /var/log/postgresql/postgresql-9.0-main.log -s -o -c
> config_file="/etc/postgresql/9.0/main/postgresql.conf" : ... failed!
>  failed!
>
>
>  so what can i do to extract the data of that tree and feed it into
> the
>  9.1 tree?
>
>  thanks in avance!
> --
> ciao bboett
> ==============================================================
> bboett@adlp.org
> http://inforezo.u-strasbg.fr/~bboett/
> ===============================================================
If you have your data directory copy it first (just for backup) and
install previous version of PostgreSQL, you may make this by
* apt (I use Gentoo)
* some precompiled packages
* compiling compatible previous version from sources

In last two cases, and probably in 1st too, You may need to manually
start PG system by invoking pg server with appropriate command
parameters (mainly cluster directory I think -D).

Personally I was in such situation and I made this what above, plus I
changed port number in configuration to different, launched PostgreSQL
in single-user mode and taken backup connecting to server at new port,
then imported backup to new version.

Regards,
Radek
http://softperience.eu

Re: help... lost database after upgrade from 9.0 to 9.1

От
Bruno Boettcher
Дата:
On Wed, Jan 04, 2012 at 10:06:53AM -0800, Adrian Klaver wrote:
Hello!

> So when you are running pg_ctlcluster 9.0 main start what user are you running
> as?
tried as root...
>
> Have you tried to directly start the 9.0 cluster as the postgres user?:
just tried, same error....

postgres@agenda:~$ pg_ctlcluster 9.0 main startError: could not exec
start -D /var/lib/postgresql/9.0/main -l
/var/log/postgresql/postgresql-9.0-main.log -s -o  -c
config_file="/etc/postgresql/9.0/main/postgresql.conf" :

> usr/lib/postgresql/9.0/bin/pg_ctl /usr/lib/postgresql/9.0/bin/pg_ctl start  -D\
> /var/lib/postgresql/9.0/main\
>  -l /var/log/postgresql/postgresql-9.0-main.log -s -o -c\
> config_file="/etc/postgresql/9.0/main/postgresql.conf"
>
>
> >
> > > Get the 9.0 server running.
ok, got it, from your lines i saw that the binaries of the server were
removed....
so i copied them over from the other server, and got the server running!
pfouuuu...... thanks a lot!

any suggestion how to keep informed about dying disks? (as you might
    have guessed, i am only a dev playing sys-admin...)

--
ciao bboett
==============================================================
bboett@adlp.org
http://inforezo.u-strasbg.fr/~bboett/
===============================================================

Re: help... lost database after upgrade from 9.0 to 9.1

От
Adrian Klaver
Дата:
On Wednesday, January 04, 2012 11:42:01 pm Bruno Boettcher wrote:
> On Wed, Jan 04, 2012 at 10:06:53AM -0800, Adrian Klaver wrote:
> Hello!
>

>
> ok, got it, from your lines i saw that the binaries of the server were
> removed....
> so i copied them over from the other server, and got the server running!
> pfouuuu...... thanks a lot!

Glad to hear:)

>
> any suggestion how to keep informed about dying disks? (as you might
>     have guessed, i am only a dev playing sys-admin...)

http://sourceforge.net/apps/trac/smartmontools/wiki

--
Adrian Klaver
adrian.klaver@gmail.com