Skip to content

Commit 708d045

Browse files
selective sync docs (#11) (#12)
Co-authored-by: Tomas Mizera <tomas.mizera2@gmail.com>
1 parent c2269ee commit 708d045

File tree

5 files changed

+70
-1
lines changed

5 files changed

+70
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"input-selective-sync": true,
3+
"input-selective-sync-dir": ""
4+
}
235 Bytes
Binary file not shown.

src/.vuepress/sidebar/en.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ module.exports = {
5353
'/components/mobile/external_gps',
5454
'/components/mobile/gps_accuracy',
5555
'/components/mobile/position_variables',
56-
'/components/mobile/reuse_last_values'
56+
'/components/mobile/reuse_last_values',
57+
'/components/mobile/selective_sync'
5758
]
5859
},
5960
{
34.5 KB
Loading
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Selective synchronization
2+
3+
<Badge text="Since Input 1.0.0" type="info"/>
4+
5+
Selective sync feature adds a possibility to alter the synchronization process to not download specified files on other devices. These files are only stored on creator's device and server and can be accessed on Mergin web or QGIS desktop. Other colleagues on different devices will not receive these files during synchronization.
6+
7+
Selective sync is useful mainly when a project contains a lot of data (for example photos) and these data do not necessarily need to be stored on all devices.
8+
9+
Practical example can be seen in the picture below. Two surveyors Jim and Susan are capturing features on a field. When it comes to synchronization, Jim first hits the [arrow icon](./data_sync.md) synchronize his changes. Features together with photos are now stored on the server. When Susan synchronizes the project, synchronization first downloads Jim's changes (including photos) and after that uploads Susan's changes to the server. However, selective sync can alter this behavior and exclude photos from being downloaded.
10+
11+
:::tip
12+
Features and other data are still being downloaded and you will see them, only photos will miss.
13+
:::
14+
15+
![Example](./images/selective-sync.png)
16+
17+
Another advantage is a significant reduction of synchronization time.
18+
19+
## How to set up selective sync
20+
21+
Selective sync is not allowed by default on new projects. Project needs to contain a specific file called `mergin-config.json` that describes the behavior. If you are not interested in customizing the behavior, skip to [get started](#get-started).
22+
23+
The config file is of type `JSON` and contains following keys:
24+
25+
- `input-selective-sync` specifies if selective sync should be allowed for this project. Keep this one as `true` in order to have selective sync enabled
26+
27+
- `input-selective-sync-dir` specifies a subfolder that should be considered for selective sync. Only files that are located inside this directory (or any of its subdirectories) will be considered. To use selective sync on all project files, leave this value as an empty _string_ `""`
28+
29+
30+
Example config setup to use selective sync on all project files:
31+
32+
```json
33+
{
34+
"input-selective-sync": true,
35+
"input-selective-sync-dir": ""
36+
}
37+
```
38+
39+
Example config setup to use selective sync only on files (photos) in subdirectory `images`:
40+
```json
41+
{
42+
"input-selective-sync": true,
43+
"input-selective-sync-dir": "images"
44+
}
45+
```
46+
47+
> Note: You can also use subsubdirectories (or any depth really) like `"resources/images"`. The path is relative to project's root directory.
48+
49+
## Get started
50+
51+
Projects with file `mergin-config.json` are set to use selective synchronization. You can either create the file on your own and copy content from previous section to it or download prepared file and add it to your project.
52+
53+
You can find `mergin-config.json` file <a :href="$withBase('/mergin-config.json')" download>here</a> and add it to your project via [Mergin website](https://public.cloudmergin.com/).
54+
55+
:::tip
56+
If download does not work, ZIP archive is available for download <a :href="$withBase('/mergin-config.zip')" download>here</a>, decompress it and use as mentioned in the previous step.
57+
:::
58+
59+
The config file needs to be placed in the root project directory where your `*.qgz` QGIS project is. These files are by default set to consider entire project directory and needs to be edited in text editor to use specific subdirectory.
60+
61+
---
62+
63+
In the future, we plan to add an option to set up selective sync conveniently in Mergin QGIS plugin.
64+

0 commit comments

Comments
 (0)