Subject Re: [firebird-support] How to rename the database after backup/restore?
Author Chuck Belanger
This is how I ended up doing it:

Initially I have been using IBOServices to do my local hard drive FDB
backups.

My routine that seems to work now:
1. Check for connected users using a query of MON$Attachments, other
than connection used in the utility app.
2. Disconnect the app I'm using.
3. GFIX shut force 0
4. Do a IBOServices backup with verbose, mainly to make sure the backup
file actually exists on the server when the code progresses to the
restore line. This creates a file with a time string embedded in its name.

5. IBOServices RESTORE simply does not work to write over the existing
FDB, so I use a ShellAPI call to GBAK using the service mgr -r o switch.
Works fine.

The backup gives me some confidence that I have a good file if something
should go wrong when restoring directly to the DB.

Afterward, I re-open the queries for the program, after putting the DB
online and re-connecting.

Is there something I'm missing for doing this DB backup/restore maintenance?

Thank you,

Chuck Belanger
> Hello:
>
> After using Firebird (2.5 SS) exclusively in a desktop application
> environment, I've created an associated app that stores data at an
> internet address.
>
> I just finished the code to allow me via a remote site to backup and
> immediately restore as a maintenance operation the database.
>
> My plan was to back up to a temp file, then restore that to another temp
> file, Disconnect, Shutdown the database with GFIX then FTP.rename the
> original database to a filename with time stamp string and then
> FTP.rename the temp file to the original database name.
>
> My mistake is that GFIX shutdown would allow this to happen.
>
> How do you allow a rename of the database in an FTP operation? Or is
> there a better way of doing what I am trying to do? I am hesitant to do
> a restore directly over the original database, but maybe someone can
> advise me on that?
>
> Thank you,
>
> Chuck Belanger
>
>
> ------------------------------------
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Yahoo! Groups Links
>
>
>
>