Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to backup firebird database using IBBackupservice

Posted on 2014-03-09
17
Medium Priority
?
1,066 Views
Last Modified: 2014-03-12
Hi, I don' know what the problem is here. I've written a program in delphi2006, using firebird database 2.5.2. What I want to do is to make a backup of the database on a remote device in my network. On the local machine no problem.
Settings of th backupservice:
- Database: D:\Databases\JAWSIE.FDB
- Protocol: TCP
- Servername: localhost
- Options: IgnoreLimbo,NoGarbageCollection,NonTransportable
- BackupFIle: \\EDMINI\LacieMario\Test.fbk

How should I do this; I also tried on another computer, no result

thx
Mario
0
Comment
Question by:marioway
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 8
17 Comments
 
LVL 19

Expert Comment

by:NickUpson
ID: 39916001
you appear to be accessing the database via a local mount of a remote disk, you cannot do this for back or any other purpose.

you need to install firebird server on the real host only, get rid of the share and then do the backup

its very unusual to use NonTransportable, be sure you have a good reason
0
 

Author Comment

by:marioway
ID: 39916128
Hi Nick, Firebird is installed on local computer, on D:\Firebird, database: D:\Databases\jawsie.fbd , I would like ot make backup on the lacie network drive (networkconnection Z:)

Mario
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 39916161
firebird will not work on a network drive, the drive containing the database file MUST be local to the process that accesses it.
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 

Author Comment

by:marioway
ID: 39916168
Nick, the database IS on the local computer, D:\Databases\awsie.fdb
0
 

Author Comment

by:marioway
ID: 39916175
When I put in BackupFile: D:\Databases\Test.fbk , it works
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 39916348
ok, I'm confused so I'll try and put my current understanding of the problem

the firebird database D:\Databases\awsie.fdb can be backedup to D:\Databases\Test.fbk but will not backup if the destination is, say, P:\Databases\Test.fbk where P is a local mount of a remote disk.

If my understanding is now correct, this should work, the backup process is just writing to a disk without any special requirements. obviously it does need windows-level permissions to write the file but thats it.
0
 

Author Comment

by:marioway
ID: 39916360
Ok Nick, so you can only write to a local disk in the local computer (let's say C or D, but not remote); I put the backupservice transportable; so when I should create fi Jawsie.fbk to D:\Databases\Backup db, make a zip file of it and copy it to the external drive, this would do the thing ? When a crash, I unzip the file and put it back on the C / drive of the local computer.
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 39916365
the backup should be able to be written to any disk, local or remote. The database has to be local.

Transportable is to do with the platforms that can restore it

the plan of write a backup locally then zip and/or copy it to a remote drive is ok, however firebirs is very resiliant to crashes.
0
 

Author Comment

by:marioway
ID: 39916380
Yes nick, but I don't understand why the backupfile is not written to my external drive, however it's visible to the local pc, \\EDMINI\LacieMario
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 39916845
I'd look at permissions, in case the backup is not allowed to write, can you write a file to the backup area a different way (not a backup)
0
 

Author Comment

by:marioway
ID: 39921799
Hi Nick, I'm back. I 've looked on the internet a bit, and found that the IBBackupservice kan only make the backup on the local pc. That's no problem, I make the backup in the backup dir locally, then put a zip-file on the ethernet disk, this works, but there is a problem with this code:

procedure THoofdfact.JfBitBtn1Click(Sender: TObject);
var p: string;
begin
with Datamodule1 do begin
 with IBBackupService1 do begin
   Active:= True;
    try
     ServiceStart;
    finally
      Active:= False;
    end;
 end;
  if IBBackupService1.Active = False then
   begin
       with Backuptablequery do begin   //backuppad ophalen
        Close;
        Prepare;
        Open;
       end;
        p:= Trim(Backuptablequery.FieldByName('BACKUPPAD').AsString);
         with Archiver do
          begin

           Filename:= p  + '\' + 'JawsieCS.ZIP';

           // Create a new archive file
           OpenArchive(fmCreate);

           // Add all files and directories from 'C:\SOURCE_FOLDER' to the archive

           AddFiles('JawsieCS.fbk');

           // Close the archive
           CloseArchive;

          end;
   end;
end;
end;

Open in new window


I get an error that the Jawsiecs.fbk is in use while trying to make the zip-file. So the service hasn't ended yet. How can I make this work ?

thx
Mario
0
 
LVL 19

Accepted Solution

by:
NickUpson earned 1000 total points
ID: 39921822
after ServiceStart of the backup you then need to wait until its complete, it can take a long time.

another alternative would be to call the firebird program gbak which will write the backup file where you want it to go
0
 

Author Comment

by:marioway
ID: 39921844
how do I call this from my Delphi app ? Shellexecute ?
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 39922120
shellexecute should work, gbak is in the firebird bin directory

"gbak -h" will give you the syntax & options
0
 

Author Comment

by:marioway
ID: 39922171
hi nick, executing from dos window

gbak -t -user SYSDBA -password "orchidee" localhost:d:/databases/jawsie.fdb \\EDMINI\LacieMario\JawsieCS.fbk  

works fine

but

 ShellExecute(Handle, 'Open', PChar('d:\Firebird\Firebird2_5\bin\gbak.exe -t -user SYSDBA -password "orchidee" localhost:d:/databases/jawsie.fdb \\EDMINI\LacieMario\JawsieCS.fbk'), '', '', SW_SHOWNORMAL);

does not work ; quid ?

mario
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 39922738
no idea, sorry
0
 

Author Comment

by:marioway
ID: 39925119
Nick, I 've got the solution

procedure THoofdfact.BackupbtnClick(Sender: TObject);
var p, q: string;
begin
 with Datamodule1 do begin
  with Backuptablequery do begin
    Close;
    Prepare;
    Open;
  end;
   p:= Trim(Backuptablequery.FieldByName('GBAKPAD').AsString) + '\gbak.exe';
   q:= '-t -l -user SYSDBA -password "orchidee" localhost:' + Trim(Backuptablequery.FieldByName('DBPAD').AsString) + '/jawsie.fdb ' + Trim(Backuptablequery.FieldByName('BACKUPPAD').AsString) + '\JawsieCS.fbk';
 end;
ShellExecute(Handle, 'Open', PChar(p), PChar(q), nil, SW_HIDE);
end;

this works perfectly

thx
Mario
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question