pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kirk Strauser <kirk@nmotioninc.com>
To: pgsql-admin@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: I wrote a program to migrate Interbase -> PostgreSQL
Date: 05 Dec 2001 09:40:27 -0600
Message-ID: <873d2p8yl0.fsf@legion.priv> (raw)

I wrote a Perl program to help my company migrate from Interbase to
PostgreSQL by extracting a database's data and metadata and dumping it as a
set of SQL commands (similar to pg_dump or mysqldump).

I wrote the program originally to do a row-level backup of our Interbase
databases.  We had a few that were corrupted, and the standard tools were
unable to extract data from them without segfaulting, so I came up with this
to scavenge as much information as possible from the failing databases.
Recently, I convinced my company to dump Interbase in favor of PostgreSQL
(yay!), but we host about 20 websites, each with databases in the hundreds
of thousands of rows, and we weren't looking forward to the data transfer at
all.  I happened to remember this program, made a few modifications, and
came up with something that Works Good Enough For Now.

My boss was gracious to let me release this under the terms of the GPL
(thanks, Don!), so feel free to mangle it to your heart's content.

Please, please, PLEASE note that this was never written to be the end-all
be-all of database conversion utilities.  It's simply the solution to a
problem that we had, and written with the needs of my company in mind.  I
hope that someone else can use it, but it may turn out to be worthless for
anyone but us.

It supports:

  - Full exporting of all data and metadata in a database.

  - A rudimentary mechanism for re-writing datatype names (a simple one-way
    Perl hash).

  - Support for converting Interbase auto-incremement triggers to PostgreSQL
    SERIAL fields, including setting the current value at the end of the
    process.

If you're interested, it can be found at:

  http://www.honeypot.net/~kirk/dbreplicate.gz

Let me know if you like it, hate it, or find it remotely useful!
-- 
Kirk Strauser
Internet Software Engineer
NMotion, Inc.



view thread (3+ messages)  latest in thread

Message-ID: <873d2p8yl0.fsf@legion.priv>
Permalink:  ../873d2p8yl0.fsf@legion.priv/
Also on:    postgresql.org/message-id/873d2p8yl0.fsf@legion.priv

 · 

reply

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-admin@postgresql.org
  Cc: kirk@nmotioninc.com, pgsql-general@postgresql.org
  Subject: Re: I wrote a program to migrate Interbase -> PostgreSQL
  In-Reply-To: <873d2p8yl0.fsf@legion.priv>
  References: <873d2p8yl0.fsf@legion.priv>

* 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