Page 1 of 1

Backip Superserver/Classic Server

Posted: Sun 11 Jun 2017 16:46
by michaschumann
I wrote a migration assistant for my application (currently FB1.5.6) to Firebird 2.5 using TIBCBackupService and TIBCRestoreService. Works great except for environments, where users have installed Firebird 1.5.6 as classic server.

In these cases the "isServiceRunning" loop seems to be left immediately while the GBAK process on the server keeps running. Perhaps I am missing an option or so? This is my backup code, the restore code is analogous. I use a callback as I also use this code in a DLL for Inno Setup.

Code: Select all

procedure backupDB(srcServer, srcDatabase, srcSysdbaPW, aBackupfile, aPort, DLL: String; AcallBack: TUpdateCallBack);
var
  IBCBackupService1: TIBCBackupService;
  cnt: integer;
  s: String;
begin
  IBCBackupService1 := TIBCBackupService.create(nil);
  cnt := 0;
  try
    with IBCBackupService1 do
    begin
      clientlibrary := DLL;
      Database := srcDatabase;
      Server := srcServer;
      Username := 'sysdba';
      Port := aPort;
      Password := srcSysdbaPW;
      Options := [];
      BackupFile.Text := aBackupfile;
      verbose := true;
      Attach;
      try
        ServiceStart;
        while IsServiceRunning do
        begin
          inc(cnt);
          if cnt > PBMAX then
            cnt := 10;
          s := extractForLog(GetNextLine);
          AcallBack(s, cnt, PBMAX);
        end;
      finally
        detach;
      end;
    end;
  finally
    IBCBackupService1.free;
  end;
end;

Re: Backip Superserver/Classic Server

Posted: Wed 14 Jun 2017 10:36
by ViktorV
To solve the issue, please try replace in your sample the string

Code: Select all

While IsServiceRunning do
with

Code: Select all

While not Eof do