First steps to QFieldCloud

Hi all!
As new Qfieldcloud beta user I have some questions I hope someone may answer.
My first connection tests work fine. What I am trying to understand are the following steps:

  1. I have a qgs project and postgis dataset. I configure the sync parameters (online, offline…)
  2. I create a qfieldcloud project, the plugin creates a new project converting my data in gpkg format in the folder I declare.
  3. My “replica project” dataset based on gpkg will be available on the cloud and I will use it in Qfield
  4. My “replica” project based on gpkg dataset will be the one which will sync with the changements I will do collecting data in Qfield

At this point I have new data in the gpkg dataset but not in my POSTGIS (original dataset). Is there a way to get back the sync data to POSTGIS?
Am I missing something or I am doing correctly?
Thanks!


Imported from GitHub discussion by @aliasatp on 2022-02-11T10:57:09Z

For information, I asked the same question but not good answer yet ! https://github.com/opengisch/QField/discussions/2467


Imported from GitHub comment by @ronanren on 2022-02-21T15:40:14Z

aliasatp Hey, thanks for testing QFieldCloud and posting a well structured question!

There are two options for you:

  1. you keep your current workflow you described and as a step 5) you create a local script that syncs back from the .gpkg to the PostGIS DB.
  2. you upload your project to QFieldCloud with the PostGIS credentials, so QFieldCloud does the synchronization for you.

2.1) first when creating the project, select the latter option “create a new empty QFieldCloud project”:


2.2) syncrhonize your local project with the cloud. Make sure you PostGIS credentials are stored withing the .qgs/.qgz project file (read below) and that layer is marked as offline editing.
2.3) QFieldCloud will be able to sync with your original PostGIS now.

Note you might feel unconfortable to put your PG credentials in the project file, which is understandable. However, this is the only way to achieve it for now. In the next 3 months there will be a new functionality to store encrypted an .pgservice credentials on the cloud.

Hope it helps!


Imported from GitHub comment by @suricactus on 2022-03-09T07:51:23Z

Hello, I am fairly new to qfield cloud but was wondering how exactly to set up the connection to my aws postgis database. You mentioned above that you have to make sure the credentials are stored with the qgs files, how and where exactly does that take place? thx !


Imported from GitHub comment by @sbec101 on 2022-03-24T20:20:45Z

I’m also looking for similar guidance with layers from PostGIS. However, I might be a step behind you. When I let the QField plug-in convert the project and send it to the cloud, I get errors on the mobile app for each layer it converted to .gpkg when I try to open it in the app. It gives an error because the “Local Directory” file path (QField/cloud/[project name]) where it exported on the machine with QGIS is unreachable. Shouldn’t the path be to the .gpkg it downloaded to the device from QField Cloud?


Imported from GitHub comment by @peoute on 2022-03-28T14:35:57Z

Looks like my issue was absolute paths. When I tried to sync again from desktop, it gave me an error, which got me to this closed issue:


Imported from GitHub comment by @peoute on 2022-03-28T14:45:26Z

Please open a new issue, this is already answered.


Imported from GitHub comment by @suricactus on 2022-06-17T13:18:37Z

The solution 2 works now with the release 0.14.2 of QFieldCloud on server in my company. Thanks you for your reactivity !


Imported from GitHub comment by @ronanren on 2022-06-20T07:03:00Z

Hello,

I’m also looking a solution to edit offline data with QFieldCloud, and then synchronized with our postgis database (witch is on a private network).
If I have well understood, the solution 2 mentionned above is only available if we want to edit online data (with a database on public network) - but what happen if we lost internet connection on the field ?

We could open the database in public, only it’s possible that in the field we do not have internet access. That’s why we need to edit our data offline with QField, and then synchronized with our PostGIS Database, when we go back to the office.

It is possible that QField Cloud manages this double synchronization ? First, from the tablet to the cloud (with gpkg files) ; and then from cloud to database (when connection to the database is possible).


Imported from GitHub comment by @sallib on 2022-09-02T08:41:36Z

Solution 2 works with offline editing on your phone. QField users have offline copy and will push their data to QFieldCloud as soon as they have internet. Then QFieldCloud will connect to your PostGIS database and will apply the user changes to the master database.


Imported from GitHub comment by @suricactus on 2022-09-02T09:05:15Z

Hello!
I am also having trouble connecting a postgis database to qfieldCloud. I followed the instructions detailed above (thanks suricactus ). When I try to open the project on QfieldCloud, the project displays me with an error message following "“permission_denied_plan_insufficient” message : “permission denied because the useraccount’s plan is insufficient”? can you tell me what to do please?


Imported from GitHub comment by @hybrixkely on 2025-03-20T10:54:16Z

Hi hybrixkely

Unfortunately, PostGIS or WMS/WFS services connected directly are not allowed in the community plan!


Imported from GitHub comment by @SeqLaz on 2025-03-20T13:36:57Z