Summary:
The sync-one-way service is used to transfer data from one space to another. In order to use the service you will need write permission on the target space and at least read permission on the source space.
What does it do?
Sync-one-way will sync up the data between two branches on two spaces, it will also keep track of the times the service has been used. This means that it will skip data that was already synced previously and will only take updated data into account when using the service subsequently.
For example:
We have a service that syncs data from space1 to space2 .Space1 contains two nodes, node1 and node2, space2 is empty.
Running the sync-one-way service will put node1 and node2 on space2.
If we delete it node2 on space 2 and run the service again, nothing will happen because node2 was already synced to that space in the previous sync.
However, if we instead would have deleted node2 on space1 and run the service again, node2 on space2 would also be deleted because that is a change in data that wasn't previously synced.
How do I set it up?
It can be set up like any service (see this page for help on setting up a service on a space), below we will describe the templates and configuration to use for this service.
Using the 'Simple' template:
When adding a service, choose the blank template.
In the 'Template' field choose the 'Simple' option.
In the 'Service name' field choose the 'Weaver Importer Exporter' option.
In the 'Function call' field choose the 'sync' option, selecting this will display the config menu.
In the 'Profile' field type in 'sync-one-way'
You should now have something that looks like this:
In the config menu, there are some optional fields (as discussed below) and a config field that has to be filled in.
In the config field, paste the following lines:
{
"sourceProject": "sync-from",
"targetProject": "sync-to",
"graph": "undefined",
"actionsPageId": 1
}
If more then one sync-one-way services are present on the space, they should all have a unique value for "actionsPageId".
In this field, "sync-from" should be replaced by the space id of the space you want to copy the data from and "sync-to" should be replaced by the space id you want to transfer the data to. The space id can be found in the submenu 'All spaces' from the 'Users and Spaces' menu.
The space id is located below the name of the space. For example we would use "ckp3ogv7i00613b69g55x3i5w " if we want to transfer data to 'Test Space 21'.
The optional fields 'Frombranch' and 'Tobranch' can be used if you have multiple branches on a space and want to transfer from a specific branch on the source space or to a specific branch on the target space. If this field is left empty it will use the 'Main' branch by default.
Similar to the branches, the field 'Fromgraph' and 'Tograph' allow you to transfer data from a specific graph on the source space or to a specific graph on the target space. If a field is empty the default graph will be used.
A complete config menu should look like this:
Using the 'Sync Project' template:
There is a template named 'Sync Project' which you can also choose. In this template you will get a list from available spaces and branches to choose from for source and target. However, it is currently not yet completed, this section will be filled in once it's done.