PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Rights required to perform a backup
  • Characteristics of the backup
  • Backup performed from the HFSQL Control Center
  • Scheduled backups
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Saves the content of a HFSQL server: all databases found on the server, one or more databases, one or more data files. This backup can be performed while one or more databases are currently used.
The backup performed will correspond to the database status at the beginning of backup: the integrity of the database is preserved. Some operations are not allowed during the backup: deleting the data files and the databases, updating the stored procedures.
The backup description can be performed via the hBackupDescription variable. In this case, you have the ability to define:
  • a stored procedure to run BEFORE the backup. This procedure can cancel the backup if necessary.
  • a stored procedure to run AFTER the backup.
To restore this backup, use HRestoreBackup.
To delete this backup physically, use HDeleteBackup.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Versions 22 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
WINDEVJava This function is now available for the Java applications.
New in version 22
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
WINDEVJava This function is now available for the Java applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
WINDEVJava This function is now available for the Java applications.
Example
Backup_Doc is hBackupDescription
Backup_Doc..Description = "Doc Backup"
Backup_Doc..WithIndex = True
Backup_Doc..Destination = "Doc/Backup"
Backup_Doc..Source = "Doc/*"
Backup_Doc..ProcedureBefore = "mydatabase:DocCol.Check"
Backup_Doc..ProcedureAfter = "mydatabase:DocCol.CheckBackup"
HBackup(MyConnection, Backup_Doc)
// Saves the wdaccounts database in the "Backup" directory
IF HBackup(gctConnection, "wdaccounts/*", "wdaccounts/Backup", True, ...
"Backup " + DateSys()) = 0 THEN
Error(HErrorInfo(hErrFullDetails))
END
Syntax

Syntax that is using the hBackupDescription type (with call to stored procedures) Hide the details

<Result> = HBackup(<Connection Name> , <Backup Definition>)
<Result>: Integer
  • Identifier of backup,
  • 0 if an error occurred. HErrorInfo is used to identify the error.
HBackup is a non-locking function: it starts the backup and gives control back to the application.
Note: If a stored procedure is run before the backup and if it returns False, the backup is canceled.
<Connection Name>: Character string (with or without quotes)
Name of connection toward the server to save. This connection was defined in the data model editor, or by HDescribeConnection or HOpenConnection.
<Backup Definition>: hBackupDescription type
hBackupDescription variable containing the description of backup to perform. In this type of variable, you have the ability to define a stored procedure to run before the backup and a stored procedure to run after the backup.

Syntax kept for backward compatibility with version 12 Hide the details

<Result> = HBackup(<Connection Name> , <Data to Save> , <Backup Destination> [, <Backup of Indexes> [, <Description> [, <Progress Bar>]]])
<Result>: Integer
  • Identifier of backup,
  • 0 if an error occurred. HErrorInfo is used to identify the error.
HBackup is a non-locking function: it starts the backup and gives control back to the application.
<Connection Name>: Character string (with or without quotes)
Name of connection toward the server to save. This connection was defined in the data model editor, or by HDescribeConnection or HOpenConnection.
<Data to Save>: Character string (with quotes)
Filter used to describe the information to save. The possible values are as follows:
*Saves all the databases found on the server, the logs, the system databases (users, groups, rights).
Database Name/*Saves the entire database: data files, links, stored procedures, triggers.
Database Name/Name File 1Saves the <Name File 1> data file found in the <Database Name> database.
Name Database 1/Name File 1 + TAB + Name Database 2/Name File 2 + ...List of elements to save. The separator can be the tabulation (TAB) or the semicolon (";").
SystemSaves the system databases (users, groups, rights).
<Backup Destination>: Character string (with quotes)
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" sub-directory 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.
<Backup of Indexes>: Optional boolean
  • True (default value) to save the indexes,
  • False not to save them. Not saving the indexes reduces the size of the backups. However, rebuilding the indexes will increase the restore time.
<Description>: Optional character string (with quotes)
Description of the backup.
<Progress Bar>: Optional character string (with or without quotes)
Name of the Progress Bar control found in the window. This control is used to view the progress of the initialization step of the backup (and not the progress of the backup). This option is available in WINDEV only.
Remarks

Rights required to perform a backup

To perform a backup, the user or the group must have the rights to perform backups (hRightsBackup constant). These rights apply to the servers and to the databases.
To find out whether a user or a group has sufficient rights, use HInfoServerRights or HInfoDatabaseRights.
To modify the rights granted to a user or to a group of users, use HModifyServerRights or HModifyDatabaseRights.

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 files and databases,
  • update the stored procedures.

Backup performed from the HFSQL Control Center

A backup can be performed from the HFSQL Control Center. This backup is available in the "Backups" tab of the server description ("New backup" button).

Scheduled backups

You have the ability to schedule the backups performed on the server:
  • via the scheduled tasks managed by WLanguage (HAddTask).
  • via the HFSQL Control Center ("Scheduled Tasks" tab of the server description).
Related Examples:
WD Duplication Training (WINDEV): WD Duplication
[ + ] This educational example explains how to duplicate a database on a server.
The duplication is performed by programming and it allows you to give a new name to the database.
The example is based on the functions for saving and restoring a HFSQL backup.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230hf.dll
Windows Mobile wp230hf.dll
Java wd230java.jar
Linux wd230hf.so
Android wd230android.jar
Minimum required version
  • Version 12
This page is also available for…
Comments
I'll teach you how to do a backup.
Na dica de hoje..
vou ensinar como fazer um backup
no inicio do sistema

In today's tip ..
I'll teach you how to do a backup.
At the beginning of the system

En el consejo de hoy ..
Voy a enseñar cómo hacer una copia de seguridad
en el inicio del sistema

// Blog com Video e Imagen

http://windevdesenvolvimento.blogspot.com.br/2017/04/aula-1112-windev-backuprestore-001.html

http://backup%20automatico%20quando%20abrir%20sistema%20-%20windev%20backup%20001/...

De matos
Apr. 07 2017