Recent

Author Topic: Show ProgressBar during backup & restore for Firebird databases  (Read 7677 times)

JD

  • Hero Member
  • *****
  • Posts: 1758
I need some advice concerning how to use a progressbar while backing up or restoring Firebird databases.

I currently use the Firebird gbak utility whose output is displayed in a Memo field on a form while backing up or restoring my database. It works perfectly but I'm not satisfied with it. I want to replace the Memo field with a progressbar but I don't know how long the backup/restore process can take.

I could have chosen to backup/restore the database using compression/decompression e.g zip but I don't want the backups to be accessible outside of my application. The gbak utility does this for me but the penalty is the inability to use a progressbar tied to its operation while it is working.

Thanks for your assistance.
Windows (10, 7) - Lazarus 2.0RC3/FPC 3.2, NewPascal, Delphi

Indy 10.6 series; mORMot; Zeos 7.2.1; SQLite, Firebird, PostgreSQL & MariaDB; VirtualTreeView 5.5.3 R1

99Percent

  • Full Member
  • ***
  • Posts: 154
Re: Show ProgressBar during backup & restore for Firebird databases
« Reply #1 on: July 22, 2010, 12:14:29 am »
For a progress bar to make any sense it must know in advance how big the job its progress is displaying. I am not familiar with gbak, but maybe it can tell you how many records or tables it is backing up beforehand and use that as reference for the progress bar.

JD

  • Hero Member
  • *****
  • Posts: 1758
Re: Show ProgressBar during backup & restore for Firebird databases
« Reply #2 on: July 22, 2010, 12:48:02 am »
For a progress bar to make any sense it must know in advance how big the job its progress is displaying. I am not familiar with gbak, but maybe it can tell you how many records or tables it is backing up beforehand and use that as reference for the progress bar.

That's the point. There's no way to know in advance. And it's not just tables, the database also includes a lot of triggers, generators & stored procedures. I'm hoping someone on the forum has some experience in this domain not necessarily with Firebird but maybe with MySQL or PostgreSQL.
Windows (10, 7) - Lazarus 2.0RC3/FPC 3.2, NewPascal, Delphi

Indy 10.6 series; mORMot; Zeos 7.2.1; SQLite, Firebird, PostgreSQL & MariaDB; VirtualTreeView 5.5.3 R1

99Percent

  • Full Member
  • ***
  • Posts: 154
Re: Show ProgressBar during backup & restore for Firebird databases
« Reply #3 on: July 22, 2010, 02:27:38 am »
I have quite a lot of experience with databases.

Backups of databases are usually done in the background with no user intervention and with automated scripts.

However if you really want a progress bar, you can try timing previous backups saving a history of timed backups in a file or registry, factor in database size in bytes and use that as a reference for the progress. Then you use TTimer to update the progress bar.
« Last Edit: July 22, 2010, 02:30:58 am by 99Percent »