Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I had a crashed opensuse 11.3 that's why I installed opensuse 12.1.. after I installed (via yast) and edited /etc/passwd

I do this:

 rcpostgresql start

and this shows on the /var/log/messeges

~ # less  /var/log/messages  | grep postgres
Dec 27 10:43:08 t1libora1 shadow[2393]: new group added - group=postgres, gid=26, by=0
Dec 27 10:43:08 t1libora1 shadow[2393]: running GROUPADD_CMD command - script=/usr/sbin/groupadd.local, account=postgres, uid=26, gid=0, home=, by=0
Dec 27 10:43:08 t1libora1 useradd[2396]: new account added - account=postgres, uid=26, gid=26, home=/var/lib/pgsql, shell=/bin/bash, by=0
Dec 27 10:43:08 t1libora1 useradd[2396]: running USERADD_CMD command - script=/usr/sbin/useradd.local, account=postgres, uid=26, gid=26, home=/var/lib/pgsql, by=0
Dec 27 11:08:45 t1libora1 su: (to postgres) root on none
Dec 27 11:08:45 t1libora1 postgresql[2998]: Starting PostgreSQL2011-12-27 13:08:45 GMT   FATAL:  los archivos de base de datos son incompatibles con el servidor
**Dec 27 11:08:45 t1libora1 postgresql[2998]: 2011-12-27 13:08:45 GMT   DETALLE:  El directorio de datos fue inicializado por PostgreSQL versión 8.4, que no es compatible con esta versión 9.1.1.**
Dec 27 11:08:50 t1libora1 postgresql[2998]: pg_ctl: no se pudo iniciar el servidor.
Dec 27 11:08:50 t1libora1 postgresql[2998]: Examine el registro del servidor.
Dec 27 11:08:50 t1libora1 postgresql[2998]: ..failed
Dec 27 11:08:50 t1libora1 systemd[1]: postgresql.service: control process exited, code=exited status=1
Dec 27 11:08:50 t1libora1 systemd[1]: Unit postgresql.service entered failed state.

how can I migrate?

share|improve this question
1  
have you tried pg_upgrade? –  Jack Douglas Dec 27 '11 at 16:28
    
yeah... but but had a bug... tomorrow I will edit this and add the bug's info. –  maniat1k Dec 27 '11 at 22:11
    
There were several fixes to pg_upgrade in 9.1.2 so you might consider using that instead of 9.1.1 (using 9.1.2 is recommended anyway) –  a_horse_with_no_name Dec 28 '11 at 10:02

1 Answer 1

up vote 1 down vote accepted

In a perfect world, you'd have a backup of your databases created with pg_dump. If you did, you could restore those database backups to your 9.1 version. Otherwise, you could reinstall 8.4 somewhere else, copy in your original database files and make a backup of all your databases and users. Then restore that backup to your 9.1

Install your old version of PostgreSQL

1.Install an instance of PostgreSQL 8.4, same version as you had on OpenSUSE 11.3. This doesn't have to be on the same machine. If it does, you could compile a version from a .tar.gz. example: http://ftp.postgresql.org/pub/source/v8.4.8/postgresql-8.4.8.tar.gz

Decompress, configure, make and install to some other directory

2.Make sure your 9.1 isn't listening otherwise 8.4 will not be able to use the 5432 port.

3.start up postgres. somedirectory/data is where you have your 8.4 data files.

su - postgres

/postgresql84_directory/bin/pg_ctl start -D /somedirectory/data -l serverlog

4.Backup your databases to a text file

/postgresql84_directory/bin/pg_dumpall > all.dbs_8.4.sql

5.Stop postgresql 8.4

/postgresql84_directory/bin/pg_ctl -D /somedirectory/data -l logfile stop

Restore your 8.4 dump file to 9.1

1.If your 9.1 version isn't working anymore, you will probably want to reinitalize your data directory.

/postgresql91_directory/bin/initdb -D /postgresql91_directory/data/  

2.Startup Postgresql9.1 again

3.Now restore the 8.4 dump file to your 9.1 instance

/postgresql91_directory/bin/psql -f all.dbs_8.4.sql
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.