I’ve done something similar. I found that as long as the everything is set up exactly the same (tables columns etc) then if you change the the database connection in Wappler on your queries, everything still works.
One thing to think about (it would be a pain though) would be to recreate the new database in the Wappler db manager. You’d need to manually create the structures etc as opposed to bulk import like you can do with a tool like Navicat. The reason I’m thinking of doing this myself, (after watching George’s demo on the db manager) is because if you create the structure in Wappler then you create a essentially a version control system with all updates tracked and rollbacks etc.
It seems to be helpful and ties in with creating new Docker targets as well.
Sorry if this is all redundant info, but they’re things I’ve found out recently. Short answer is you can change db connection and if structure is identical, then all your sever connect actions should continue to work.
Thanks @Philip_J - I actually used the Wappler DB Manager to construct the entire DB structure, I’m just not sure the correct way within Wappler to replicate this exactly. I’m not sure if it’s possible to create a new connection and then apply changes and it creates the entire schema again?
I’ll dig up George’s tutorial and see if that presents some answers to the above!
If you have created the whole database structure with the database manager, all changes are kept and you just can switch to the new target and reapply them!
I’ll be trying this out today, thanks @George. Out of curiosity, I’m currently using Postgres due to having initially gone with Heroku, do you foresee any issues if I switch to MySql and try to have Wappler apply changes to that?
I just switch from mariaDB to postgres and there have been things I’ve needed to change/fix in my server connect queries.
Not sure if it would be the same in reverse and some of them might have been my own fault with how I imported data into the DB with how postgres handles auto increments but just something to consider.
Yes as Database Manager is cross database compatible, as long as you have used its data types and kept the changes, you can switch to different database type and reapply the changes.
I noticed, when editing the connection file for another thread that Wappler creates a JSON for existing an existing DB it is connecting to. Could this not be used by Wappler to duplicate schema if the DB didn’t originate from Database Manager?