- WLanguage properties that can be used with the hBackupDescription type
- Limit on the number of backups (LimitNumberBackups property)
- Parameters of the stored procedure called BEFORE the backup
- Parameters of the stored procedure called AFTER the backup
- Functions that are using the hBackupDescription variables:
hBackupDescription (Variable type) In french: hDescriptionSauvegarde
Available only with this kind of connection
The hBackupDescription type is used to programmatically describe an HFSQL Client/Server backup. This backup can be performed immediately or it can be scheduled. You can define and change the characteristics of this backup using different WLanguage properties. Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
// Describe an immediate backup Backup_Doc is hBackupDescription Backup_Doc.Description = "Doc Backup" Backup_Doc.WithIndex = True Backup_Doc.ProgressBar = "PROGBAR_MyProgressBar" Backup_Doc.Destination = "Doc/Backup" Backup_Doc.Source = "Doc/*" Backup_Doc.ProcedureBefore = "mydatabase:DocCol.Check" Backup_Doc.ProcedureAfter = "mydatabase:DocCol.CheckBackup" Backup_Doc.LimitNumberBackups = 5 // Save backup HBackup(MyConnection, Backup_Doc)
New in version 2025
Backup_Doc is hBackupDescription
Save_Doc.Description = "SaveWithRight"
Backup_Doc.WithIndex = True
Backup_Doc.Destination = "Back/RightBackup"
Save_Doc.Source = "Anonymization/*"
Sauvegarde_Doc.Ftp.Connexion.Serveur = "chorizo-2k8"
Save_Doc.Ftp.Connection.User = "TT"
Backup_Doc.Ftp.Connection.Password = "TT"
Save_Doc.Ftp.Connection.PortNumber = 22
Save_Doc.Ftp.Connection.ConnectionType = ftpModeActive
Backup_Doc.Ftp.DestinationPath = "/tmp"
HBackup(MyConnection, Backup_Doc)
// Create a scheduled backup every 5 minutes // with a differential backup every minute hBck is hBackupDescription hBck.Enabled = True hBck.WithIndex = True hBck.Description = "Scheduled backup every N minutes " + ... " with a differential backup every minute on the database " + ... cnt.Database + " created on "+ DateToString(DateSys(), maskDateSystem) + ... " at " + TimeToString(TimeSys(), "HH:MM:SS:CC") hBck.Destination = "Backup_"+ cnt.Database hBck.LimitNumberBackups = 2 hBck.Source = cnt.Database hBck.SchedulingFull.Month = "*" hBck.SchedulingFull.DayOfMonth = "*" // Define the scheduling dtServerDateTime is DateTime = HInfoServer(cnt, hInfoDate) dtServerDateTime.Minute++ hBck.SchedulingFull.Hour = dtServerDateTime.Hour hBck.SchedulingFull.Minute = dtServerDateTime.Minute hBck.SchedulingFull.DayOfWeek = "*" hBck.SchedulingFull.DayOfMonthOrDayOfWeek = False hBck.SchedulingDifferential.Month = "*" hBck.SchedulingDifferential.DayOfMonth = "*" hBck.SchedulingDifferential.Hour = "*" hBck.SchedulingDifferential.Minute = "*" hBck.SchedulingDifferential.DayOfWeek = "*" hBck.SchedulingDifferential.DayOfMonthOrDayOfWeek = False // Add the scheduled backup IF HAddScheduledBackup(cnt, hBck) = False THEN Error("Failure creating the scheduled backup", HErrorInfo(hErrFullDetails)) RETURN END
Properties WLanguage properties that can be used with the hBackupDescription type The following properties can be used to define the characteristics of hBackupDescription variables: | | | Name | Type used | Effect |
---|
Compression | Integer constant | Used to compress (or not) the result of backup. This property can correspond to one of the following constants:- zipFormatAucun: No compression.
- zipFormatZIP: Zip compression.
| New in version 2025Data masking | Integer constant | Allows you to manage the anonymization of data contained in the backup: - hSvgAnonymizedAboutRights:
Backup data is anonymized according to the rights of the user making the backup: - Administrator: all anonymized fields are unencrypted in the backup.
- User without right to de-anonymize fields: all anonymized fields are hidden.
- Users with the right to de-anonymize certain fields: only fields that can be de-anonymized are displayed in clear text in the backup. Other sections are hidden.
- hSvgNonAnonymized (Default value):
Fields are only non-anonymized if the administrator saves them. In other cases (users without the right to de-anonymize, or users with the right to de-anonymize certain fields), the backup fails. - hSvgAnyAnonymized Whatever the rights of the user making the backup, anonymized fields remain anonymized in the backup.
Warning: Restoring a backup with anonymized fields: If the backup contains anonymized data, the data will remain anonymized when restored (and will therefore be unreadable, whatever the rights of the user wishing to access it). | Description | Character string | Description associated with the backup. This property is optional. The backup description corresponds to an empty string ("") by default. | Destination | Character string | Destination of the backup (name and destination of the backup). 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.
Examples: - To store the backup in a directory that corresponds to the year, day, and time in the "Backup" subdirectory, use:
// Store backup in 2021_21_13 Backup_Doc.Destination="%%YEAR%%_%%DAY%%_%%HOUR%%"
- To save the backup in a "Doc/Backup" directory at the same level as the Manta service directory, use:
Backup_Doc.Destination="%%EXE%%/Doc/Backup/%%YEAR%%"
New in version 2025Attention In case of anonymization (property Anonymization property other than constant hSvgNonAnonymized), the backup destination must not correspond to a UNC. | Enabled | Boolean | Used to manage the activation of a scheduled backup: - True if backup schedule is enabled: backup is performed according to the defined schedule.
- False if backup scheduling is not enabled: backup is not performed.
| New in version 2025Ftp.Connection | ftpConnection variable | Characteristics of the connection to the FTP server to which the backup is to be copied. If this property is not specified, no copy is made on the FTP server. | New in version 2025Ftp.DestinationPath | Character string | Backup copy path on FTP server. This property is only taken into account if the property Ftp.Connection property is set. | Identifier | Integer | Backup identifier. This property is read-only. | LimitNumberBackups | Integer | Maximum number of backups of the same type to perform. There is no limit if this number corresponds to 0. If the number of backups exceeds the limit value, some former backups will be removed from the server. For more details, see "Operating mode of the limit regarding the number of backups". | ProcedureAfter | Character string | Name of the stored procedure used after the execution of the backup. The procedure name is of the form: <Nom de la base de données>:<Nom de la collection de procédures>.<Nom de la procédure stockée>.
This property is optional. No procedure is run if this property is not defined.
For more details, see "Parameters of the stored procedure called AFTER the backup". | ProcedureBefore | Character string | Name of the stored procedure used before the execution of the backup. The procedure name is of the form: <Nom de la base de données>:<Nom de la collection de procédures>.<Nom de la procédure stockée>.
This property is optional. No procedure is run if this property is not defined.
For more details, see "Parameters of the stored procedure called BEFORE the backup". | ProgressBar | Control name | Name of the Progress Bar control used in the window to view the progress of the initialization step of the backup (and not the progress of the backup).
Optional property available in WINDEV only. | SchedulingDifferential | hScheduling variable | Characteristics of a differential scheduling. You have the ability to define both a full scheduling and a differential scheduling. No differential scheduling can be performed on its own. This property is optional. | SchedulingFull | hScheduling variable | Characteristics of a full scheduling. This property must be specified. | Source (*) | Character string | Filter used to define the data to back up. The possible values are:- *: Makes a backup copy of all the databases of the server, the logs, the system databases (users, groups, rights).
- Database name/*: Saves the entire database: data files, bindings, stored procedures, triggers.
- Database name/Name Data file 1.fic: Saves the data file <Nom Fichier de données 1> from the database <Nom de la base de données>.
- Database name 1/Name Data file 1.fic + TAB + Database name 2/Name Data file 2.fic + ... List of items to be saved. The separator can be the tabulation (TAB) or the semicolon (";").
- System: Backup system databases (users, groups, rights).
This property must be specified. | User | Character string | User who has created the backup. This property is read-only. | WebhookAfter | Character string | URL of a REST service that will be triggered after the backup and the procedure specified with the ProcedureAfter procedure (if it exists). 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: { "identify": "283", "destination": "c:\backup\283\monbackup.zip", "state": "completed" } where: - "identifier" corresponds to the backup identifier.
- "destination" corresponds to the backup destination.
- "state" corresponds to the state of the backup. Different states are possible: 'completed', 'cancelled' or 'error'.
| WithIndex | Boolean | - True if indexes must be backed up,
- False otherwise.
This property is optional. By default, the backup copy of the indexes is made. |
The properties followed by (*) are mandatory. Remarks Limit on the number of backups (LimitNumberBackups property) When the limit on the number of backups is defined (LimitNumberBackups different from 0): - Before backup: search for similar backups (same source and destination). If these backups are in error, the files of the backup will be erased from the disk (but the backup will remain in the history of backups).
- Running the "Before Procedure".
- Backup.
- Running the "After Procedure".
- If the number of similar backups (same source and same destination) successfully performed is greater than the limit value, the server will delete some of these backups and will remove them from the history. This deletion starts from the oldest backup until the number of backups is equal to the requested value.
Note This property can be used to implement a specific backup system. For example: - A daily backup while storing the last 7 backups.
- A weekly backup while storing the last 4 backups.
- A monthly backup while storing the last 6 backups.
Parameters of the stored procedure called BEFORE the backup 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 be saved>: String corresponding to the information to be saved. 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/* | Backup the entire database: files, bindings, stored procedures, triggers. | Database name/Name of File1 | Makes 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 (";"). | System | Makes 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.
Parameters of the stored procedure called AFTER the backup 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 be saved>: String corresponding to the information to be saved. 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/* | Backup the entire database: files, bindings, stored procedures, triggers. | Database name/Name of File1 | Makes 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 (";"). | System | Makes 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.
- <State>: integer (or integer-type constant) used to determine the status of the backup:
| | | hBackupCanceled | 2 | Backup canceled | hBackupCompleted | 1 | Backup completed | hBackupError | 3 | Error during backup | hBackupInProgress | 0 | Backup in progress |
- <Error Message>: Error message if it exists in the form of a string.
Functions that are using the hBackupDescription variables: | | HAddScheduledBackup | Adds a scheduling for full backup (with or without differential backup) on the server defined by the connection. | HAddScheduling | Adds a new scheduled item to an HFSQL server: scheduled task (stored procedure), backup, optimization or refresh of a materialized view. | HBackup | Backs up the contents of an HFSQL server: all server databases, one or more databases, one or more data files. | HDeleteScheduling | Delete a scheduled item on an HFSQL server: scheduled task (stored procedure), backup, optimization, refresh of a materialized view. | HExecuteScheduling | Immediately executes a scheduled item regardless of its scheduling: scheduled task (stored procedure), backup, optimization, refresh of a materialized view. | | Lists the execution history of a scheduled item on an HFSQL server: scheduled task (stored procedure), backup, optimization, refresh of a materialized view). | HModifyScheduledBackup | Modifies a backup scheduling. | HModifyScheduling | Modify a scheduled item on an HFSQL server: scheduled task (stored procedure), backup, optimization, refresh of a materialized view. | | Deletes the execution history of a scheduled item on an HFSQL server: scheduled task (stored procedure), backup, optimization, refresh of a materialized view.). |
This page is also available for…
|
|
|