Subject Re: [IB-Conversions] re:Fox to Interbase with IBO/IB_WISQL?
Author Helen Borrie
OK, here is a proposal:

There is very little documentation around about converting existing ISAM
dbs to InterBase. This is the main reason we started this list. Those who
have done conversions can help those who haven't. We keep the postings -
suggestions, trials, tribulations, etc. and use them to build
source-database-specific guidelines for those who come after.

A good place for you to start will be the two articles at
http://www.interbase.com/open/research/articles.htm, one on converting from
Paradox, the other from dBase. I've done FoxPro to Paradox, others may
have done different conversions, so we do have a starting point, at least.

To start the ball rolling, the FASTEST way to do a conversion is to output
your tables to fixed-length text files and bring them into interbase as
EXTERNAL FILES. It's also the best way to get past the nasties that exist
in the old database. Broadly, you script and create your new database
structure and then insert rows by querying the external files.

But, if you have blob fields in the old database, you can't use this method.

Your next place to go is to a datapump. I think Delphi's datapump will
have problems if you want your new database to use Dialect 3, because it
uses the BDE and the BDE's latest Interbase driver doesn't know about the
Dialect 3 datatypes. For datapumping, the best tool to use is the datapump
in Claudio Valderrama's IB_Wisql.exe, which you can download free from the
IB Objects site.

SCRIPTING vs INTERACTIVE METADATA CREATION
There are tools around that let you create tables and add metadata
interactively. Just from my own experience, this is the worst way to build
an SQL database. You have no documentation; and there is no way to make
sure objects get created in the right order. If you keep the Data
Definition Guide and Language Reference beside you, scripting is easy to
do. Use Notepad, use copy-and-paste. You quickly become familiar with the
syntax.

When I make a new database, I have four scripts with names that reflect
their creation sequence.
1) script0.sql creates the database, the domains and the generators. (If
you are using IB_wisql, comment out the create database line, as there
appears to be no way to do it by scripting - it has to be interactive -
Claudio, correct me if there is a way...)
2) script1.sql creates the tables, views, indexes and triggers in correct
dependency order.
3) script2.sql is kept for all ALTER stuff.
4) script3.sql creates any referential triggers I do manually (I don't
blindly use FOREIGN keys to do ref. integrity) and all the stored procedures.
5) script4.sql contains INSERT statements for loading control tables (i.e.
tables in which I keep static data, such as country, timezone, etc. as well
as things like account types, and so on).

Will that do to start with?

Let's get this ball rolling...

Helen
-----------------------------------------------------------
At 02:39 PM 11-07-00 -0500, Joe Fay wrote:
>I'm new to your list, and glad to have it available, since I'm almost a
>rank beginner with Interbase AND IBO. I have an existing app that uses
>FoxPro 2.6 tables, and since the BDE doesn't handle FoxPro tables too
>well (the indices have a nasty habit of getting corrupted %#@*&^!) I
>recognized that I need to do something different. Helen mentioned your
>elist when trying to answer my fledgling questions about conversion,
>status of Interbase, and components to use, so, hat in hand, I'm bringing
>my problem here.
>
>My goal is to convert all of those fox tables to an Interbase database,
>with as little problems in data type conversion as possible, and to at
>least duplicate the indices where applicable, and to replace as many of
>those nasty little FoxPro 'valid' and 'when' clauses with stored
>procedures, triggers, views, and the other nice features of Interbase.
>The platform will be Windows 95 (I know...), and the app to be written in
>Delphi 4 C/S with all the patches
>
>My first question is this: Is there an extant help file, essay,
>whatever, on the entire process of doing such a thing? You know, a way
>to get an overall view of the entire process, with pitfalls, that covers
>as much of this as possible? I realize I will have to do a lot of
>reading to get from Oracle 7 and DB2 to Interbase using IB_Objects...I'm
>prepared for that. But I must admit, after cruising the Interbase and
>IBO sites a lot today, that I might be just a bit overwhelmed, but not
>discouraged. : )
>
>Sorry for the length of this post, but I wanted to include as much info
>as might be needed to facillitate any help you could offer.
>
>Joe Fay
>Musician, programmer, and erstwhile poet.

http://www.interbase2000.org
___________________________________________________
"Ask not what your free, open-source database can do for you,
but what you can do for your free, open-source database."
(J.F.K.)