-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Tomas Mizera <[email protected]>
- Loading branch information
1 parent
c2269ee
commit 708d045
Showing
5 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"input-selective-sync": true, | ||
"input-selective-sync-dir": "" | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Selective synchronization | ||
|
||
<Badge text="Since Input 1.0.0" type="info"/> | ||
|
||
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. | ||
|
||
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. | ||
|
||
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. | ||
|
||
:::tip | ||
Features and other data are still being downloaded and you will see them, only photos will miss. | ||
::: | ||
|
||
![Example](./images/selective-sync.png) | ||
|
||
Another advantage is a significant reduction of synchronization time. | ||
|
||
## How to set up selective sync | ||
|
||
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). | ||
|
||
The config file is of type `JSON` and contains following keys: | ||
|
||
- `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 | ||
|
||
- `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_ `""` | ||
|
||
|
||
Example config setup to use selective sync on all project files: | ||
|
||
```json | ||
{ | ||
"input-selective-sync": true, | ||
"input-selective-sync-dir": "" | ||
} | ||
``` | ||
|
||
Example config setup to use selective sync only on files (photos) in subdirectory `images`: | ||
```json | ||
{ | ||
"input-selective-sync": true, | ||
"input-selective-sync-dir": "images" | ||
} | ||
``` | ||
|
||
> Note: You can also use subsubdirectories (or any depth really) like `"resources/images"`. The path is relative to project's root directory. | ||
## Get started | ||
|
||
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. | ||
|
||
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/). | ||
|
||
:::tip | ||
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. | ||
::: | ||
|
||
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. | ||
|
||
--- | ||
|
||
In the future, we plan to add an option to set up selective sync conveniently in Mergin QGIS plugin. | ||
|