5.7. Bidirectional Site Sync¶
Ngenea Hub provides the facility for syncing data between sites.
Bidirectional Site Sync is similar to Site Sync, but applies changes in both directions. If a Bidirectional Site Sync runs between sites A and B, changes on site A will be applied on site B, followed by changes on site B being applied on site A.
Synchronisation is achieved by utilising a scheduled workflow which periodically discovers file and directory changes within an Independent Fileset on each of the sites and applies those changes to the other site. Changes are applied by sending newly created or recently modified files and directories, including deleting or moving files or directories in place on the target site as necessary to match the other site.
A prerequisite for a working Bidirectional Site Sync is that the Independent Fileset has been created on both sites.
The principles of setting up Bidirectional Site Sync are similar (but with some differences explained below) to setting up a Site Sync, so please refer to the walkthrough on the Site Sync page for detailed instructions. It can be done using the Ngenea Hub UI or the REST API.
5.7.1. Schedule¶
Discovery
Create a new schedule. Unlike with Site Sync, for Bidirectional Site Sync set the schedule's Discovery
to bidirectional_snapdiff
.
This discovery type operates identically to the snapdiff
discovery type, with snapshots used to track changes over time within an Independent Fileset.
A separation is enforced between bidirectional_snapdiff
schedules and schedules with other discovery types. Whereas the Discovery
of other schedules may be changed, a change from or to the bidirectional_snapdiff
discovery type is not allowed. This is to ensure consistency of the specific workflow rules that apply to Bidirectional Site Sync.
Time criteria
Unlike with Site Sync, a Bidirectional Site Sync will not be triggered if the previous sync is still running. This means that some syncs will be skipped if scheduled closer together than the time it takes to complete a sync.
5.7.2. Workflow¶
Subscribing a workflow
Select the Bi-directional Site Sync
workflow.
This is the only workflow that may be subscribed to a bidirectional_snapdiff
schedule, and it cannot be subscribed to other types of schedule.
A bidirectional_snapdiff
schedule may have at most one subscribed workflow.
Outcome
When executing the scheduled workflow, only one job is created and appears within the schedule details page. This job includes the tasks for both the snapdiff discoveries (one on each site), as well as the tasks that enact the sync in each direction.
5.7.3. Troubleshooting¶
If you encounter issues with sync, refer to the sync troubleshooting guide page for guidance.