Target setting database not work

hello everyone, I have set different database configurations in the various targets but when I publish the project they both point to the same database.
If I understand correctly, the targets are designed to publish on target servers with different configurations, right?
Can I check in some file the saved settings?
Can I manually edit the connection string on the version published in production?

Please check:

Hi Teodor, I looked at the documentation you linked to me but I’m a bit confused.
I selected below my target (Prod) and created a new connection to the production database (both dev and production DB are on Azure), published the project online but it still points to the dev database.

I also noticed an error (I am attaching a screenshot) it seems I am missing a configuration file for the db connections.

My current target configuration is this:
Local server development + db sql azure (yoocare-dev)
Stagin remote server dev + db sql azure (yoocare-dev)
Production remote server prod + db sql azure (yoocare)

When I publish from wappler I would like staging and productin to point to their respective db.

Thank you!

You don’t need another database connection.
You need only one database connection. It is the connection used in all your server actions.

Switch to development target, open your database connection under Server Connect Globals > edit the settings for development database. Save (Ctrl+s / Cmd+s)
Close the database connection tab.

Switch to staging target, open your database connection under Server Connect Globals > edit the settings for staging database. Save (Ctrl+s / Cmd+s)
Close the database connection tab.

Switch to remote target, open your database connection under Server Connect Globals > edit the settings for remote database. Save (Ctrl+s / Cmd+s)

That’s all, and that’s what the tutorial i linked to explains.

I followed the procedure you described but both stagin and prod see the same data.
Should the configurations in the target tab be deleted? (screen)
Is there any other check I can do?

Why do you think so? Are there errors when you use the database connections on your targets?
It’s really easy to see if the settings per target have been updated … by changing a target and opening the database connection options in server connect the way i explained above.

I have no errors but the staging site and the production site see the staging database data, I’ll give you the example in this screen:
I selected the target and changed the database name.
In the staging database I have 3 users with role P while in the prod only 1
I published the sites via the publish tool but both see 3 users with the P role so the connection string of the online version of the prod site is incorrect and points to the staging database.

Can I check the connection string on the remote prod server by opening some configuration file?

The settings per target are kept in the hidden .wappler folder in your site root.

So navigate to: .wappler > targets > target_name > app > modules > connections > connection_name.json

Ok I check to see that everything is correct

owwww the folder for target prod doesn’t exist and in the staging folder the config is empty (Maybe because the same settings as development?)
Maybe there is some corrupted file, try to remove the targets and recreate them?

If I go to the database section with the selected target I see two databases and if I open them it shows me this error, File C:\Users\enriw\AppData\Local\Wappler\resources\app\Shared\DMXzone\Databases\Connections\node\dmxDatabase .json does not exist!