Firebird ADO.NET Provider SDK Documentation - v1.7

FbBackup Class

Back up a database to a file or tape device. This class cannot be inherited.

For a list of all members of this type, see FbBackup Members.

System.Object
   FirebirdSql.Data.Firebird.Services.FbService
      FirebirdSql.Data.Firebird.Services.FbBackup

[Visual Basic]
NotInheritable Public Class FbBackup
    Inherits FbService
[C#]
public sealed class FbBackup : FbService

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

Paths of backup files are relative to the server. Since the Services Manager executes backup and restore tasks on the server host, the Services Manager reads and writes backup files on the server host.

The username and password used to connect to the services manager will be used to connect to the database for backup. This helps add some degree of security for this operation. Only the SYSDBA user or the owner of the database will be able to backup a database.

Example

The following example makes a backup of a database to a single file and display server output on Console.

[STAThread]
static void Main(string[] args)
{
    FbConnectionStringBuilder cs = new FbConnectionStringBuilder();

    cs.UserID   = "SYSDBA";
    cs.Password = "masterkey";
    cs.Database = "nunit_testdb";

    FbBackup backupSvc = new FbBackup();
                
    backupSvc.ConnectionString = cs.ToString();
    backupSvc.BackupFiles.Add(new FbBackupFile(@"c:\testdb.gbk", 2048));
    backupSvc.Verbose = true;

    backupSvc.Options = FbBackupFlags.IgnoreLimbo;

    backupSvc.ServiceOutput += new ServiceOutputEventHandler(ServiceOutput);

    backupSvc.Execute();
}

static void ServiceOutput(object sender, ServiceOutputEventArgs e)
{
    Console.WriteLine(e.Message);
}                

Requirements

Namespace: FirebirdSql.Data.Firebird.Services

Assembly: FirebirdSql.Data.Firebird (in FirebirdSql.Data.Firebird.dll)

See Also

FbBackup Members | FirebirdSql.Data.Firebird.Services Namespace