Synchronization

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

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

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

Options

Created since / Options

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

Match locations / Synchronization folder

When the "Match locations" option is selected, synchronized reports are placed in the same folder path as in the source system. If the path doesn't exist, it will be created.

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

Combine permissions / Override permissions / Do not change permissions

"Combine permissions": Combined permissions from both source and target systems if the report/path exists.

"Override permissions": Copies permissions from the source system; existing permissions are removed.

"Do not change permissions": No changes to permissions are made.

Note that synchronization does not create user groups in the target system; existing groups are used.

By default, synchronization synchronizes all objects matching the search criteria. You can exclude selected objects from synchronization. The output is a SQL script executable in the target installation.

Calling synchronization programmatically

You can programmatically call synchronization to automate the process. Parameters include:

  • run: Set to 1 to execute synchronization.
  • source: Determines use of creation date (created_since) or folder ID (folder) for synchronization basis.
  • date: Synchronizes objects changed since the defined date.
  • folder_id: Synchronizes objects in the defined folder ID.
  • perm: Defines permission handling: combine, override, or none.
  • loc: Defines folder structure creation: match or folder.
  • folder: When folder structure is folder, specifies the folder name.

Check the generated URL from the UI. Note that when called programmatically, the date is 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;

?>