Backing up using the network Firebird server

Top  Previous  Next

**Important information regarding backing up if utilizing the network Firebird database server**

 

 

Never make a direct copy of the AyaNova database file with the Firebird services running.

 

Do not use external proprietary backup utilities or file-copying tools such as WinZip, tar, copy, xcopy, etc., to make a copy of the actual database file.

 

Not only will the backup be unreliable, but the disk-level blocking used by these tools can corrupt a running database.

 

Only use the gbak utility as per the information provided below

 

 

Included in the AyaNova program installation is the batch file called networkFirebirdsnapshot.bat

 

This file (once edited to reflect your information) creates a snapshot file of the AyaNova database file every time it is run.

 

There is no need to shut down the Firebird database to create this snapshot. The provided batch file (once edited with your information) takes a snapshot of the state of the database at the moment it starts, so users can continue working while a backup runs, allowing 24x7 operation.

 

Only this utility can be used to create a snapshot of the live AyaNova database.

 

And its the snapshot file that is to be backed up never the actual live database file.

 

The first time the batch file is run, it creates a snapshot file AYANOVA.FBK

 

The second time it is run, it renames the first to AYANOVA02.FBK and creates a new snapshot file AYANOVA.FBK

 

The third time it is run, it renames AYANOVA02.FBK to AYANOVA03.FBK, renames the AYANOVA.FBK to AYANOVA02.FBK, and creates a new snapshot file AYANOVA.FBK and so on

 

Once 10 snapshots have been created, it will delete the oldest snapshot, shuffle renaming the existing and create a new snapshot, and so on.

 

Direct your backup process to backup all the snapshot files in the backup folder.

 

Or direct your backup process to backup just the AYANOVA.FBK snapshot as that will be the latest snapshot.

 

It is suggested that you create a Scheduled Task to run the batch file (once it has been edited to reflect your information) just prior to the backup process occurring, so your backup process backs up the latest snapshot each time.

 

 

 

 

Editing the snapshot creation file

 

1.Using NotePad, open the networkFirebirdsnapshot.bat file for editing
2.Replace the default SYSDBA password “masterkey” with the password you set in the installation of the network Firebird server
3.The networkFirebirdsnapshot.bat file defaults to referring to the path of the database file as C:\Data\AyaNova\AYANOVA.FDB
4.If this is NOT where the AyaNova database file is than you need to edit the path of where it actually is.
a.Refer to your aliases.conf file (from the Firebird folder) for the location of your AYANOVA.FDB database file
5.The networkFirebirdsnapshot.bat file defaults to referring to the path where the snapshot files will be created as C:\Data\AyaNova\backups
6.If this is NOT where you want the snapshot files created at than you need to edit the path of each line that refers to C:\Data\AyaNova\backups to the actual path where you want these files created
a.It is recommended that the snapshot files be created to a separate folder than the live AyaNova database file so no confusion for the backup process no accidental backup of the actual live database file.
7.Save and close the file

 

Testing the snapshot creation file

1.Open a command window (Start -> Run -> cmd)
2.Move to AyaNova 3 program directory

C:\Program Files\Ground Zero Tech-Works Inc\AyaNova 3

3.Type

networkFirebirdsnapshot.bat

4.Press the Enter key
5.If a message occurs stating an issue and the snapshot does not run, resolve and repeat the above steps until snapshot is successful
6.Close the command window
7.Open Windows Explorer and move to the location where you specified the snapshots to be created
8.Confirm that the snapshot file was created.

 

 

Creating a Scheduled Task to auto-run the snapshot batch file

 

1.Once you have confirmed that the edited batch file successfully creates a snapshot of the AyaNova database file, open Control Panel and open Scheduled Tasks
2.Select Add Scheduled Task to start the task wizard
3.Select Next
4.Browse to the location of the networkFirebirdsnapshot.bat file and select it
5.Select to perform Daily; select Next
6.Select a time of day prior to your backup process; select Next
7.Enter the username and password for the administrator of this computer; select Next
8.Select Finish
9.It is recommended that you confirm on a regular basis that the snapshots are actually being created
10.It is recommended that you confirm on a regular basis that your backup process is backing up the snapshots

 

 

 

 

Restore the database with a network Firebird server

 

 

 

Situation: The AyaNova v3 program is still installed, the network Firebird server is installed, but an issue with the database requires restoring from backup:

 

1.Ensure no one is accessing the AyaNova database (via the AyaNova program or directly)
2.Ensure the Generator is shut down
3.Shut down the Firebird services (Control Panel -> Firebird Server Manager -> Stop)
4.Rename the existing database to AYANOVA.FDB.BAD
a.Never ever restore overtop of an existing AYANOVA.FDB database file.
5.Start the Firebird services (Control Panel -> Firebird Server Manager -> Start)
6.Restore the snapshot of the database the AYANOVA.FBK file using the following:
a.Open a command window and move to the Firebird program bin folder

C:\Program Files\Firebird\Firebird_1_5\bin

b.Extract the AyaNova database file from this restored file using similar to this command line substituting as needed the password, the snapshot file location and file name, and the location to restore the AyaNova database file to:

gbak -c -v -user SYSDBA -password masterkey C:\Data\AyaNova\BACKUPS\AYANOVA.FBK C:\Data\AyaNova\AYANOVA.FDB

7.Check that the AYANOVA.FDB file is restored
8.Log in via the AyaNova program and confirm successful

 

 

Situation: Computer has no previous AyaNova 3 installation

 

1.Perform all the steps of the section “Installation of AyaNova using network Firebird database server”
2.Log in to the trial AyaNova database and ensure program installation successful
3.Close out of the AyaNova program
4.Ensure all users are not accessing the AyaNova program
5.Ensure the Generator is shut down
6.Shut down the Firebird services (Control Panel -> Firebird Server Manager -> Stop)
7.Rename the existing database to AYANOVA.FDB.TRIAL
a.Never ever restore overtop of an existing AYANOVA.FDB database file.
8.Start the Firebird services (Control Panel -> Firebird Server Manager -> Start)
9.Restore the snapshot of the database the AYANOVA.FBK file by the following:
a.Open a command window and move to the Firebird program bin folder

C:\Program Files\Firebird\Firebird_1_5\bin

b.Extract the AyaNova database file from this restored file using similar to this command line substituting as needed the password, the snapshot file location and filename, and the location to restore the AyaNova database file to:

gbak -c -v -user SYSDBA -password masterkey C:\Data\AyaNova\BACKUPS\AYANOVA.FBK C:\Data\AyaNova\AYANOVA.FDB

10.Check that the AYANOVA.FDB file is restored
11.Log in via the AyaNova program and confirm successful