In database connections tab I setup another db connection to the remote server, just in case I could find a way to switch to it, but no idea how to make sure the right connection is sent to my remote server.
Maybe I am thinking is a too complicated way (Which I doubt ) but there must be a very logical basic way to make sure a connection is associated with a target?
I got totally lost and confused with all this different connection settings. For me, it worked this way:
Create the different environments / targets, but did not enter database details in the project settings (not sure what their are for)
Select your environment (bottom left), go to globals / database connection / your db connection (only one is required!) and open the connection options. Enter the database settings for the selected environment.
Close(!) that db connection tab (Important, otherwise the settings are not refreshed after the following switch!)
Switch your target to production (or how your publishing target is called)
Open your DB connection and enter for production. Again, save and close(!) the tab.
Now every publishing target has its own settings.
I had similar challenges, you find a bit more info here:
I think this issue is hanging around after all this time because the CLOSE THE TAB action is the ONLY WAY Wappler “works” but was not specified in tutorials as a necessary requirement in the whole process of defining different targets.
Close(!) that db connection tab (Important, otherwise the settings are not refreshed after the following switch!)
Switch your target to production (or how your publishing target is called)
Open your DB connection and enter for production. Again, save and close(!) the tab.