Subject Re: restore between different Databases
Author Adam
--- In, "Maurizio P." <mauriz_po@...>
> hi ,
> it is my first application i use Firebird 1.5 ,
> is it possible restore data between different structured DataBases ?
> customer has a non finished version of the program , and he is
registering data in
> this program DB , in this meanwhile i added fields , tables ,
triggers , to
> the DB of the same program i am finishing to develope ,
> now i have to upgrade the DB of the customer to the new version ,
> can i make a back up from the customer DB and restore it in my new
version program DB ?

What if you have renamed a field, added a new constraint, dropped a
field or a table, the list goes on as to why this can not be reliably

Basically gbak can only restore to a structure that looks identical to
the one that was backed up. You can use a data pump tool to copy data
from the old structure to the new, and as long as the change is
reasonably simple, it works quite well. (You may need to redirect some
old to new fields, or old to new tables.)

> or what is the best way to do it ?

That is subjective, but the best way I have found to made DDL upgrades
is to write a DDL script that does whatever is required to convert
from old to new. It is sometimes necessary to create temporary stored
procedures to copy the data to new structures. Each DDL script in our
software is numbered, and as each is applied to a database, the DDL
number is stored in the database. We have a simple upgrade tool that
looks at what version the database is currently on, then generates and
runs an upgrade script, so we can quickly upgrade any customer on any
version to 'the latest stable'.