From: John R Pierce <pierce@hogranch.com>
To: pgsql-bugs@postgresql.org
Subject: Re: could not migrate 8.0.13 database with large object data to 9.5.1
Date: Mon, 29 Feb 2016 21:33:06 -0800
Message-ID: <56D52992.4090001@hogranch.com> (raw)
In-Reply-To: <56D55C2B0200004C0001F975@heineken.nsasia.co.th>
References: <56D55C2B0200004C0001F975@heineken.nsasia.co.th>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On 2/29/2016 6:08 PM, Premsun Choltanwanich wrote:
> I have very old project database which also contain lo data (large
> object data managed by database's functions as lo(oid),
> lo_in(cstring), lo_oid(lo), lo_out(lo) and oid(lo) to manage ) running
> on PostgreSQL 8.0.13 and need to migrate it to most recently version
> as PostgreSQL 9.5.1.
>
> After install PostgreSQL 9.5.1, I running a simple command pg_dumb to
> 8.0.13 server with parameters required for generate dump file by blobs
> also be included then running psql with all required parameters to
> create those dump data to 9.5.1 server. However, almost tables are
> transferred to new server after the process completed except tables
> which contain my lo data that all those tables are missing from the
> database.
>
> Please advise to me, How could I migrate 8.0.13 database with large
> object data to be working on 9.5.1?
phew, 8.0 has been unsupported now for several years.
that said, the latest pg_dump and pg_dumpall are supposed to be able to
dump just about any postgres database going back as far as 7.4 (?) in a
format that can be restored on the same version as the pg_dump software.
if you have an old and new server running side by side, I'd try, from
the new server...
1) if needed, configure the old server to allow the new one to log onto
the old postgres databases (pg_hba.conf, and possibly listen_address
and/or firewall rules), verify this works with 'psql -h oldserver
dbname' as the postgres user on the new server.
2) from the /new/ 9.5 server, as the postgres user,
$ pg_dump -Ft -h oldserver olddatabase | pg_restore -d newdatabase
(where newdatabase is a fresh empty database on the new server)
if you have the two database servers running side by side on the same
server using different ports and paths, then, as the postgres user...
$ /usr/pgsql-9.5/bin/pg_dump -p oldport -Ft olddatabase |
/usr/pgsql-9.5/bin/pg_restore -p newport -Fc newdatabase
if you've already done pretty much the same thing as this, and/or if
these fail the same way, it would be useful to look at the postgres
logfile from when you ran the dump and restore jobs on both servers.
--
john r pierce, recycling bits in santa cruz
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: pierce@hogranch.com
Subject: Re: could not migrate 8.0.13 database with large object data to 9.5.1
In-Reply-To: <56D52992.4090001@hogranch.com>
References: <56D55C2B0200004C0001F975@heineken.nsasia.co.th> <56D52992.4090001@hogranch.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox