Developing with local dev & live production db connections

OS info

  • Operating System : Windows 6.1.7601
  • Wappler Version : 1.9.0

Problem description

The locations of my webapp and MySQL database are different between my local development environment and production environments. As a result in production, my web app displays properly but no data are displayed in the forms. How do I compensate for this?

Steps to reproduce

Here is how I have done it:

  1. Create two publish targets - dev & prod (which you too have probably done)
  2. Make sure dev & prod MySQL db schema are replicas
  3. Create one db connection
  4. When using dev, go to any server action, edit the db connection and set values as per your dev environment. When you save db connection settings, dev MySQL schema is applied.
    Publish your app and everything should work fine.
  5. When using prod, go to any server action, edit the db connection and set values as per your prod env. eg: server would be some IP instead of localhost. Username, password, db name could be different too.
    Save, schema will refresh, but remain same. Publish & everything should work fine on prod.

I did this multiple times while developing my application and found no issues.
Just make sure all server actions use the same db connection.

If you want, you can also create two db connections. Then you will be shown an option to select the connection. But this would require you to edit each and every server action every time you need to switch between dev & prod.

I appreciate your suggestions and I think I understand what you are telling me to do.
However I have been unable to find the IP address of the production server.

I am publishing to an Azure Web App using the MySQL in App option. The best I can understand the MySQL db is in a sandbox that has restricted access.

Difficult to know how to setup the prod target Server Address In Wappler.

In the Azure environment where I would normally find the public IP address, I find the following,

VIRTUAL IP ADDRESS

No IP-based SSL binding is configured

Thanks again for your help

Pete D.

IP address/Domain name is required in case you have the MySQL server at a different location than the server where application is hosted.
If they are both in the same server, you can probably access it via localhost. In which case, you will just have to change username/password between dev & prod.