Skip to content

Enable download of project with a filter to include/exclude certain files or filetype #233

Closed

Description

@raherin

In many cases we need to download a previous version of a project but only need the project files. In these cases, it would be useful to be able to add a filter to the project download, for example to exclude all media files, so we aren't downloading several GBs of data when we only need the project and config files.

Examples:
mergin download ws/projectname --exclude=media/* --exclude=mybgnd.mbtiles
mergin download ws/projectname --include=data/* --include=*.gpkg --include=project.qgz

No mixing between includes and excludes.

Activity

  1. dracic commented on Jun 9, 2025

    @dracic

    And also this would be useful in db-sync. No need to download all images to sync gpgk to PostgreSQL.

  2. MarcelGeo commented on Sep 11, 2026

    @MarcelGeo
    Contributor

    Feel free to start testing of this functionality @RastoHu . When using command mentioned in description or client.download_project() method with exclude / include params - downloaded files are following this rules. Configuration of excluded / included files is stored in .mergin folder. Filters are stored just one time and after download - you do not have any option to revert these.

  3. added this to the 0.15.0 milestone on Sep 16, 2026
  4. RastoHu commented on Sep 16, 2026

    @RastoHu

    testing ok with one exception:

    1. download project with include option, e.g. mergin --url https://app.dev.merginmaps.com/ download "<workspace>/<project>" ./<local_folder> --include "*.gpkg" --include "*.qgz"
    2. go to local folder: cd local_folder
    3. try download file with excluded type, e.g. test.txt (must exist in project on server): mergin --url https://app.dev.merginmaps.com/ download-file test.txt ./tmp/test.txt -> excluded file is downloaded to the local project
  5. MarcelGeo commented on Sep 17, 2026

    @MarcelGeo
    Contributor

    @RastoHu let's provide some examples for cli calls.

  6. RastoHu commented on Sep 23, 2026

    @RastoHu

    @RastoHu let's provide some examples for cli calls.

    mergin --url https://app.dev.merginmaps.com/ download "test onboarding/test_gpkg_in_subfolders" ./gpkg_qgz_v2 --version v2 --include "*.gpkg" --include "*.qgz"
    mergin --url https://app.dev.merginmaps.com/ download "test onboarding/test_gpkg_in_subfolders" ./exclude_jpeg --version v7 --exclude "*.jpeg" --exclude "*.jpg"
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions