Help / WLanguage / Managing databases / HFSQL / Managing replications
  • Overview
  • Implementation
  • Necessary conditions
  • Steps to follow
  • Installing the replication server
  • Defining the replication
  • Programming the replication
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Replication of mobile data (Android or iOS)
HFSQL ClassicHFSQL Client/ServerAvailable only with these kinds of connection
The Assisted Universal Replication is available in Android and iOS.
This replication allows you to replicate data coming from different databases.
Android This replication mode cannot be used to perform a replication between an SQLite database and an HFSQL database.

Necessary conditions

  • The analysis must be shared between the WINDEV and WINDEV Mobile application (Android or iOS).
  • The Master database must be an HFSQL database (Classic or Client/Server).
  • The mobile database (Subscriber) must be an HFSQL Classic database.
  • The structure of the database must be strictly identical on the two platforms.

Installing the replication server

The setup of the replication server is presented in the page named Replication server for the assisted universal replication.
  • IMPORTANT: The date and time time must be identical on the server and on the Android/iOS devices. The internal dates (the ones used by the replication in the HFSQL files) are in UTC.
  • The setup package of the replication server is provided with WINDEV, WEBDEV and WINDEV Mobile. It is located in the "\Install\WDRServer" subdirectory of the IDE installation folder.
  • If you own WEBDEV sites, the replication server and the WEBDEV Application Server can be installed on the same server.
Caution: Specific rights must be granted on the installation directory of replication server. Read rights and execution rights must be granted to the Internet user (IUSR_Computer_name account) on this directory (and in the sub-directories).

Defining the replication

The replication is defined by ReplicEdit.
The steps for creating a replication for the Android/iOS applications are as follows:
  1. Create a replication.
  2. Add files into a replication.
  3. Publish the replication.

Programming the replication

In the Mobile application, the WLanguage functions must be used to perform the synchronization.
The wizard for publishing the replication on the replication server provides a basic code:
// Opens a replication on the replication server
ReplicOpen("replication name", "", "IP address", "login", "password")

// Initializes the replication by passing the parameters 
//IF ReplicInfo("replication name", replicInitialized) = False THEN
// ReplicInitialize("replication name", <Parameters>)

// Starts the synchronization
ReplicSynchronize("replication name")
The following functions must be used:
ReplicInfoReturns information about a replication.
ReplicInitializeInitializes or reinitializes a replication defined by the replication editor (ReplicEdit).
ReplicOpenOpens a replication in direct mode or with a replication server.
ReplicSynchronizeSynchronizes the data corresponding to a replication.
Remark: In the code of the Android (or iOS) project, don't forget to configure the connection to the local database (HFSQL Classic file on the mobile device).
Minimum version required
  • Version 19
Click [Add] to post a comment

Last update: 09/06/2023

Send a report | Local help