I’m editing my question because after further testings, I can make a proejct from scratch with postgres layers and it works fine!
So my problem is to convert an existing project containing postgres layers to the Cloud. This is something I would really appreciate, because we are building a solution that implies uploading such a project on several occasions during a season. The project contains many postgres layers and QGIS Relations, so I would really like not to have to recreate it from scratch every time we make an update and have to share it with our collaborators (we can’t just share all the same Cloud version, as they have to modify some environment variables on their side afterward).
For the moment, the option to transform an existing project to the Cloud transforms all the layers to Geopackages. With the old QFieldSync, this was OK because the plugin would push the modifications to the postgres layers when importing them, but I don’t understand how to do the same with the Cloud sync version…
Am I doing something wrong, or this function is not yet supported?
QGIS 3.22.4
QFieldSync v4 (non-Beta)
Win10Pro 21h2
Imported from GitHub discussion by @OBVYamaska on 2022-03-16T21:33:08Z
Hey OBVYamaska , thanks for testing QFieldCloud.
When you are creating a project in QFieldSync there are two options. Select the second one:
This means QFieldCloud server will directly connect to your PostGIS database. Every time you download the project on their phone, the geopackages will be recreated from the newest data in the PostGIS database. This is similar to what was happening in the old QFieldSync, but on the cloud.
When you do you fieldwork and push your changes, they will be applied directly in the PostGIS database.
To make this work, you need to ensure two things:
- your Postgres credentials must be stored within the QGIS project file (
.qgs
/.qgz
).
- your Postgres database must allow connections from the app.qfield.cloud IP.
There is an upcoming feature that QFieldCloud will support .pgservice
or similar approach to store your Postgres credentials securely, but this is a known limitation for now.
Hope I have answered your question. This was already discussed here too First steps to QFieldCloud · opengisch/QField · Discussion #2508 · GitHub
Imported from GitHub comment by @suricactus on 2022-03-21T10:24:08Z
It kinda answers my question indeed; I tells me what I’m looking for is not yet supported.
What you are proposing is that I recreate the project from scratch, starting from QFieldCloud. This involves recreating all my Relations and manually managing all the corresponding forms.
My question was about being able to convert my existing project to the Cloud without having to go through all this process.
I’ll look into it to see if this can be a suitable solution. As I said, the QGIS project needs to be copied to a bunch of partners (because of distinct credentials and environment variables), and these partners don’t have the skills to recreate the project from scratch this way.
Thanks!
Imported from GitHub comment by @OBVYamaska on 2022-03-21T14:37:37Z
This involves recreating all my Relations and manually managing all the corresponding forms.
Not really. If you have a project that uses only online services (e.g. PostGIS/WFS/WMS) you can crate a new blank project (as in the screenshot above) and upload only the .qgs file to the cloud. It should automatically work, alongside with all the relations, forms and other configuration.
If you have other files (e.g. TIFFs or GPKGs) that are stored outside the directory where your .qgs file resides, you need to move them within the same directory first and upload all of them to the cloud.
I’ll look into it to see if this can be a suitable solution. As I said, the QGIS project needs to be copied to a bunch of partners (because of distinct credentials and environment variables), and these partners don’t have the skills to recreate the project from scratch this way.
If you manage to have a single configuration to work for all, then it is definitely doable.
Imported from GitHub comment by @suricactus on 2022-03-21T17:24:50Z
Hi suricactus ,
I tried you first option (creating an empty project and copying the existing .QGZ with postgres layers), which would be sufficient for me, but I couldn’t make it work. Essentially, the project syncs and I can open it on QGIS, but QField fails to download a local version.
An alternative would be for me to create the whole project from scratch, and then invite collaborators so they could copy the “original” project onto their account and use it from there. But is this possible? I don’t see an option to “copy” a online project from one account to another…?
Imported from GitHub comment by @OBVYamaska on 2022-03-23T01:42:53Z
Essentially, the project syncs and I can open it on QGIS, but QField fails to download a local version.
May I ask what do you see in the web interface? Checked in the logs and I am pretty sure you have experienced “timeout error”? If this is the case, I would suggest to slim the project a bit and try again.
Imported from GitHub comment by @suricactus on 2022-03-23T05:22:08Z
Essentially, the project syncs and I can open it on QGIS, but QField fails to download a local version.
May I ask what do you see in the web interface? Checked in the logs and I am pretty sure you have experienced “timeout error”? If this is the case, I would suggest to slim the project a bit and try again.
I did a test with a lighter version of the project and indeed, it worked fine. Pretty neat, I must say 
That being said, our project aims to hold a lot of forms to keep them available on the field. I have ideas to work around that limitation, but do you know if this is something that could be improved? I don’t mind waiting a long time for it to sync, and I would rather do that and have my full project, than to have to export cutouts of this project!
Thanks
Imported from GitHub comment by @OBVYamaska on 2022-04-07T22:46:04Z
Soon it will be possible to have extra time period for your project jobs. However, this is what is available right now.
Imported from GitHub comment by @suricactus on 2022-04-11T11:17:59Z
Out of curiosity, are we talking about weeks or months for this extra time period? I simply want to decide if I wait before using QCloud with my partners, or if I implement a workaround in the meantime.
Thanks again for you great work!
Imported from GitHub comment by @OBVYamaska on 2022-04-11T14:50:31Z
Go for the workaround, cannot promise it will be delivered that soon, but it is on the top of the priority list.
Imported from GitHub comment by @suricactus on 2022-04-12T02:15:45Z
suricactus How can I allow connections from the app.qfield.cloud IP to Postgres database?
Thanks.
Imported from GitHub comment by @mnmalhassan on 2022-04-12T09:23:11Z
I’m running into issues with this too. How do I store my postgres credentials in the project?
I’ve had success with getting my project (with the database) onto QField on my tablet using QFieldCloud, but it seems like I only succeed with this 1 out of every 25 times I try.
I’m visiting a few watersheds. For each watershed QGIS project, I have to have a few vector layers and my postgres database. Vectors are working fine, but the lookup tables (needed) seem to be causing problems when I try to convert the projects to QFieldCloud. Any idea what I’m doing wrong here?
Imported from GitHub comment by @shelbysawyer on 2022-11-01T21:06:27Z
See my edited answer up there; if you use the option to convert the actual project to QFieldCloud, the plugin will convert your postgres tables to geopackage and you will lose the connection. What worked for me was to create the repertory where I want to store my Cloud project, copy my .QGZ file there, and THEN create the Cloud project using the “Create QFieldCloud project from scratch” option. There, you will point to the repertory you created earlier, and your postgres connections will be maintained.
Hope this helps you!
Imported from GitHub comment by @OBVYamaska on 2022-11-01T21:33:40Z
That being said, the other issue I get is that there is a sync time cap of 600s on QFieldCloud projects.
So projects with a lot of data simply can’t make it through… which is now most of my projects. I have to downgrade substantially most of my work to be able to use QFieldCloud, which is a shame, because the tool would be so great is it simply had a longer max time…
Imported from GitHub comment by @OBVYamaska on 2022-11-01T21:36:46Z
Soon will be 
Imported from GitHub comment by @suricactus on 2022-11-01T22:15:01Z
Hi suricactus
Any update on the matter? I tested this and the time limit still seems to be there.
I’m also in a strange position, where I asked for support a couple weeks back and got no answer from info or sale.
We had budget planned to finance help from your team, but as it has to be spent before March 31th, I fear this money is simply going to disappear… I would rather have it going your way, and I believe our request is gonna be both relatively straight forward and helpful to you!
Is there someone to whom I could speak before the end of the month? I believe nirvn is from Quebec too, this could help explain our project?
Anyway, sorry to ask this here, I don’t really know how to reach you otherwise… if there is a better way, please tell me!
Imported from GitHub comment by @OBVYamaska on 2023-03-21T20:25:59Z