Synchronization

The function and allows you to synchronize changes from one myDBR installation to another. Objects to be synchronized are:

Report related objects are synchronized based on report procedure creation date (or by folder if folder-based synchronization is selected). This means that just changing report info does not trigger the synchronization.

Templates, Localizations, and Additional routines are synchronized based on a creation time.

Options

Created since / options

Will determine if reports synchronized are selected based on creation date or by the folder.

Match locations / Synchronization folder

When the "Match locations" option is selected, the synchronized reports will be placed in the same folder (based on folder name) path as in the source system. If the folder path does not exist, it will be created.

If the "Synchronization folder" option is selected, the folder (created if needed in main top-level if needed) is used to store the synchronized reports that do not exist in a new server.

Combine permissions / Override permissions / Do not change permissions

When the "Combine permissions" option is selected, the permissions for the report (and report path) will be combined permissions from both source and target system if the report/path already exists.

With "Override permissions" permissions for report and report path will be copied from the source system. The additional existing permissions will be removed.

With "Do not change permissions" no permission changes are done.

Note that the synchronization will not create user groups in the target system. If user groups exist, they will be used.

The synchronization will by default synchronize all objects that match the search criteria. You can exclude the selected object from synchronization. The output from the synchronization is a SQL script you can execute in the target installation.

Calling synchronization programatically

You can also call synchronization programatically. This allows for you to automate the synchronization process. The parameters are:

  • run - set to 1 to execute the synchronization
  • source - Determines if one uses date created_since or folder ID folder as basis for the synchronization
  • date - Syncs objects changed since the defined date
  • folder_id - Syncs objects in the defined folder ID
  • perm - Define how to treat permissions: combine, override or none
  • loc - Define how create the folder structure: match or folder
  • folder - When folder structure is set to folder define the folder name

You can also take a look at the generated URL from the UI. Note that when called programatically, the date will be in ISO format (YYYY-MM-DD).

curl -u "username:password" -L -H "X-MYDBR-AUTH: 1" "https://yourserver.com/mydbr/index.php?a=sync>run=1>source=created_since>date=2020-12-24>loc=match>folder=myDBR+Sync>perm=combine>styles=1"
<?php

$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, 'https://yourserver.com/mydbr/index.php?a=sync>run=1>source=created_since>date=2020-12-24>loc=match>folder=myDBR+Sync>perm=combine>styles=1'); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERPWD, 'username:password');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-MYDBR-AUTH: 1'));
$data = curl_exec($ch); 
curl_close($ch); 

header('Content-Type:text/plain');

echo $data;

?>