ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / Managing HFSQL Client/Server
  • Overview
  • Backups in the HFSQL Control Center
  • Overview
  • Creating a backup
  • Creating a scheduled backup
  • Operations on the backups
  • Backups through programming
  • Creating an immediate backup through programming
  • Creating a scheduled backup through programming
  • WLanguage functions used to manage the backups (full, differential, scheduled and immediate backups)
  • Remarks
  • Characteristics of the backup
  • Management of a procedure before and/or after
  • Managing a webhook
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
How to backup HFSQL Client/Server databases?
HFSQL Client/ServerAvailable only with this kind of connection
Overview
The backup of the HFSQL Client/Server databases can be performed:
Backups in the HFSQL Control Center

Overview

The HFSQL Control Center is used to create and manage:
  • full or differential backups,
  • immediate or scheduled backups.

Creating a backup

Remark: The backups performed according to this method are necessarily full backups. The differential backups can only be performed via scheduled backups.
To create a backup:
  1. Connect (if necessary) to an HFSQL server.
  2. Double-click the name of HFSQL server in the tree structure.
  3. The right section of Control Center displays a tab with the server name.
  4. Click the "Backups" tab.
  5. In the ribbon, in the "Backups" group, expand "New backup" and select "New hot backup". The wizard for creating a backup starts.
  6. Specify the content of the backup:
    • The entire content of the server.
    • A specific database.
    • A selection of databases and/or data files.
  7. Go to the next step of the wizard and specify the backup options:
    • whether the result of the backup must be compressed in a zip file.
    • whether the backup must contain the index files (NDX index files and FTX full-text index files). If the index files are not saved, the size of the backup will be reduced but the restore time will be longer. Remark: if the index files are not saved, the passwords of the files must be specified during the restore operation to allow their reindexing.
  8. Proceed to the next step of the wizard.
  9. Specify the backup location by specifying the backup directory. If this name corresponds to a relative path, the backup will be performed in the "Backup" subdirectory of the HFSQL server. The wizard is used to define a "backup" subdirectory ("Backups" by default). The date and the time (in "Year\Month\Day\Time-Minute" format) can be added to the name of the directory in order to easily identify the backup.
    Remark: The backups are performed in a numbered subdirectory ("backup\Backups\1" for example). Therefore, if several backups are performed, the corresponding files will not be overwritten by a new backup.
  10. Proceed to the next step of the wizard.
  11. Specify the actions associated with the backup:
    • Stored procedure before or after backup: In this case, the next step of the wizard is to specify:
      • the name of the database containing the stored procedure to run,
      • the name of the set of procedures containing the stored procedure to run,
      • the name of the procedure to run.
    • Webhook run after backup: In this case, the next step of the wizard is to specify the URL of the webhook (REST service) to which the backup result should be sent.
  12. Give a description to your backup and validate.
  13. The backup is automatically started. The progress of the backup can be monitored in the HFSQL Control Center.
Remark: You also have the ability to perform a backup from the "Backups" tab of a database selected in the treeview on the left of the screen.

Creating a scheduled backup

To create a scheduled backup:
  1. Connect (if necessary) to an HFSQL server.
  2. Double-click the name of HFSQL server in the tree structure.
  3. The right section of Control Center displays a tab with the server name.
  4. Click the "Backups" tab.
  5. In the ribbon, in the "Backups" group, expand "New backup" and select "New scheduled backup". The wizard for creating a backup starts.
  6. Specify the content of the backup: the entire server content, a specific database, a selection of databases and/or files.
  7. Go to the next step of the wizard and specify the backup options:
    • whether the result of the backup must be compressed in zip format.
    • whether the backup must contain the index files (NDX index files and FTX full-text index files). If the index files are not saved, the size of the backup will be reduced but the restore time will be longer. Remark: if the index files are not saved, the passwords of the files must be specified during the restore operation to allow their reindexing.
  8. Proceed to the next step of the wizard.
  9. Choose a scheduling scenario among the preset scenarios. You can also choose a custom scheduling. In this case, the next steps of the wizard will guide you through the definition of the schedule.
  10. Proceed to the next step of the wizard.
  11. Specify the backup location by specifying the backup directory. If this name corresponds to a relative path, the backup will be performed in the "Backup" subdirectory of the HFSQL server. The wizard is used to define a "backup" subdirectory ("Backups" by default). The date and the time (in "Year\Month\Day\Time-Minute" format) can be added to the name of the directory in order to easily identify the backup.
    Remark: The backups are performed in a numbered subdirectory ("backup\Backups\1" for example). Therefore, if several backups are performed, the corresponding files will not be overwritten by a new backup.
  12. Proceed to the next step of the wizard.
  13. Specify the actions associated with the backup:
    • Stored procedure before or after backup: In this case, the next step of the wizard is to specify:
      • the name of the database containing the stored procedure to run,
      • the name of the set of procedures containing the stored procedure to run,
      • the name of the procedure to run.
    • Webhook run after backup: In this case, the next step of the wizard is to specify the URL of the webhook (REST service) to which the backup result should be sent.
  14. Specify whether you want to limit the number of backups stored on the server.
  15. Give a description to your backup and validate.
  16. The backup will be automatically started according to the specified scheduling. The progress of the backup can be monitored in the HFSQL Control Center.

Operations on the backups

The HFSQL Control Center allows you to handle the existing backups. You can:
  • Create a backup.
  • Restore a backup.
  • Restore a backup found in a specific directory.
  • Delete a backup. To delete a backup, you must be a "Superuser".
  • Restart a backup (option available in "Other actions").
  • Retrieve a backup on the client computer (option available in "Other actions").
To perform these operations:
  1. Connect (if necessary) to an HFSQL server.
  2. Double-click the name of HFSQL server in the tree structure.
  3. The right section of Control Center displays a tab with the server name.
  4. Select the "Backups" tab.
  5. Select the backup to handle.
  6. The options specific to the backup management are found in the "Backups" group of the ribbon. The are used to:
    • create a new backup (hot or scheduled backup),
    • restart a backup,
    • restore a backup,
    • delete a backup,
    • retrieve a backup. This option is available for the backups performed in the format of a ZIP file only. All you have to do is specify the location where the backup file will be saved.
Backups through programming
Several WLanguage functions can be used to manage the backups through programming. You can:
  • full or differential backups,
  • immediate or scheduled backups.

Creating an immediate backup through programming

To create an immediate backup through programming:
  1. Define the characteristics of the backup via a hBackupDescription variable. If the backup is an immediate backup, only a full backup can be performed.
  2. Perform the backup with HBackup.

Creating a scheduled backup through programming

To programmatically create a scheduled backup:
  1. Define the characteristics of the backup using a variable of type hBackupDescription and its scheduling options. You have the ability to define a differential backup associated with a full backup.
  2. Add the scheduled backup via HAddScheduledBackup.

WLanguage functions used to manage the backups (full, differential, scheduled and immediate backups)

The following WLanguage functions can also be used to manage the backups:
HAddScheduledBackupAdds a scheduling for full backup (with or without differential backup) on the server defined by the connection.
HBackupMakes a backup copy of the content of an HFSQL server: all databases on the server, one or more databases, one or more data files.
HCancelBackupCancels a current backup.
HDeleteBackupDeletes a backup previously created with HBackup.
HDeleteScheduledBackupDeletes a scheduled backup from an HFSQL Client/Server server.
HExecuteScheduledBackupForces the execution of a scheduled backup.
HInfoBackupReturns information about one or more backups performed on an HFSQL Client/Server server.
HListScheduledBackupLists the full and differential backups that have been scheduled on HFSQL Client/Server.
HModifyScheduledBackupModifies a backup scheduling.
HRestoreBackupUsed to restore:
  • an immediate backup (performed by HBackup or via the HFSQL Control Center),
  • a scheduled backup (described by HAddScheduledBackup or via the HFSQL Control Center.
HRetrieveBackupRetrieves locally the content of a compressed backup (in ZIP format) performed on an HFSQL server.
Remarks

Characteristics of the backup

The backup performed will correspond to the status of the database at the beginning of backup.
During the backup, you are not allowed to:
  • delete the data files and the databases,
  • update the stored procedures.

Management of a procedure before and/or after

It is possible to call a stored procedure before or after the backup. These procedures can take parameters.
Management of a procedure before: The stored procedure called BEFORE the backup can take parameters. This procedure has the following format:
PROCEDURE <Procedure name>(<Data to back up>, ...
<Backup destination>, <Description>)
These parameters are optional. They will allow you to handle the following indications in the code of the stored procedure:
  • <Data to back up>: Character string corresponding to the information to back up. Corresponds to the Source property. The possible values are as follows:
    *Makes a backup copy of all the databases of the server, the logs, the system databases (users, groups, rights).
    Database name/*Makes a back up copy of the entire database: files, links, stored procedures, triggers.
    Database name/Name of File1Makes a back up copy of <Name of File1> found in <Database name>
    Name of database 1/Name of File1 + TAB + Name of database 2/ Name of File2 + ...List of elements to back up. The separator can be the tabulation (TAB) or the semicolon (";").
    SystemMakes a backup copy of the system databases (users, groups, rights).
  • <Backup destination>: Name and destination of the backup. Corresponds to the Destination property. The backup will be preformed on the server, in a location defined by this name. If this name corresponds to a relative path, the backup will be placed in the "Backup" subdirectory of the HFSQL server. To specify:
    • the directory of the Manta service, use the "%%EXE%%" character string.
    • the year, use the "%%YEAR%%" character string (2008 for example).
    • the month on 2 digits, use the "%%MONTH%%" character string (03 for example).
    • the day, use the "%%DAY%%" character string.
    • the hour, use the "%%HOUR%%" character string.
    • the minutes, use the "%%MINUTE%%" character string.
  • <Description>: Backup description. Corresponds to the Description property.
Management of a procedure after: The stored procedure called AFTER the backup can take parameters. This procedure has the following format:
PROCEDURE <Procedure name>(<Data to back up>, <Backup destination>, ...
<Description>, <Status>, <Error message>)
These parameters are optional. They will allow you to handle the following indications in the code of the stored procedure:
  • <Data to back up>: Character string corresponding to the information to back up. Corresponds to the Source property. The possible values are as follows:
    *Makes a backup copy of all the databases of the server, the logs, the system databases (users, groups, rights).
    Database name/*Makes a back up copy of the entire database: files, links, stored procedures, triggers.
    Database name/Name of File1Makes a back up copy of <Name of File1> found in <Database name>
    Name of database 1/Name of File1 + TAB + Name of database 2/ Name of File2 + ...List of elements to back up. The separator can be the tabulation (TAB) or the semicolon (";").
    SystemMakes a backup copy of the system databases (users, groups, rights).
  • <Backup destination>: Name and destination of the backup. Corresponds to the Destination property. The backup will be preformed on the server, in a location defined by this name. If this name corresponds to a relative path, the backup will be placed in the "Backup" subdirectory of the HFSQL server. To specify:
    • the directory of the Manta service, use the "%%EXE%%" character string.
    • the year, use the "%%YEAR%%" character string (2008 for example).
    • the month on 2 digits, use the "%%MONTH%%" character string (03 for example).
    • the day, use the "%%DAY%%" character string.
    • the hour, use the "%%HOUR%%" character string.
    • the minutes, use the "%%MINUTE%%" character string.
  • <Description>: Backup description. Corresponds to the Description property.
  • <Status>: integer (or Integer constant) used to find out the status of the backup:
    hBackupCanceled2Backup canceled
    hBackupCompleted1Backup completed
    hBackupError3Error during backup
    hBackupInProgress0Backup in progress
  • <Error message>: Error message (if it exists) in character string format.

Managing a webhook

A webhook allows you to trigger a process automatically via a REST service. Simply enter the URL of the REST service.
A POST request will be performed on the provided URL. The URL receives an "application/json" content corresponding to the information on the backup. For example:
{
"identifier": "283",
"destination": "c:\backup\283\mybackup.zip",
"state": "completed"
}
where:
  • "identifier" corresponds to the backup identifier.
  • "destination" corresponds to the backup destination.
  • "state" corresponds to the state of the backup. There are different states: 'completed', 'canceled' or 'error'.
Minimum version required
  • Version 15
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 11/21/2023

Send a report | Local help