我有一个崩溃的opensuse 11.3,这就是我安装opensuse 12.1的原因。安装(通过yast)和编辑/etc/passwd之后
我这样做:
rcpostgresql start这显示在/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.我怎么能迁移?
发布于 2011-12-28 06:47:53
在一个完美的世界中,您可以使用pg_dump创建数据库的备份。如果这样做了,可以将这些数据库备份还原到9.1版本。否则,您可以在其他地方重新安装8.4,复制原始数据库文件,并对所有数据库和用户进行备份。然后将备份恢复到9.1
1.安装PostgreSQL 8.4的实例,与OpenSUSE 11.3上的版本相同。这不一定要在同一台机器上。如果是这样,您可以从.tar.gz编译一个版本。示例:http://ftp.postgresql.org/pub/source/v8.4.8/postgresql-8.4.8.tar.gz
解压缩、配置、制作和安装到其他目录
2.确保9.1没有监听,否则8.4将无法使用5432端口。
3.启动postgres。有些目录/数据是您拥有8.4个数据文件的地方。
su - postgres
/postgresql84_directory/bin/pg_ctl start -D /somedirectory/data -l serverlog4.将数据库备份到文本文件中
/postgresql84_directory/bin/pg_dumpall > all.dbs_8.4.sql5.停止postgresql 8.4
/postgresql84_directory/bin/pg_ctl -D /somedirectory/data -l logfile stop
1.如果您的9.1版本不再工作,您可能想要恢复您的数据目录。
/postgresql91_directory/bin/initdb -D /postgresql91_directory/data/ 2.重新启动Postgresql9.1
3.现在将8.4转储文件还原到9.1实例
/postgresql91_directory/bin/psql -f all.dbs_8.4.sqlhttps://dba.stackexchange.com/questions/9763
复制相似问题