Moving from local MySQL to hosted?

Hi All,

Just a general question which I’m sure lots will know the answer to.

I’ll be starting a new project soon and was planning on setting it up with a standard local WAMP setup and local MySQL database.

If I later add a webhost target, with a MySQL database hosted with my web host, will all the server connect queries still work? Or would they need to be recreated?

Naturally the database would need to have all the exact same table and field names etc. Just wondering if it’s a matter of changing the database connection?

So basically I’m wanting to work on a local environment, including local database set-up, but later on move everything to a webhost environment/target with a replica database through them?

Cheers,
Phil

Yes, both databases would need to be identical. If your remote target accepts localhost as a remote address for your database all you have to do is make sure you have the same username and password on both and you shouldn't have to change a thing.

But the main thing is that your database structure be identical. You can always edit the connection info.

Where you may run into issues is working on the site again locally if you have to keep changing the connection file.

I run aa similar setup with MAMP Pro, I just use the remote database right from the start with local development files. Not ideal but it's better than having to redo connections all the time.

1 Like

To add to what Brad has already said I believe you wouldn’t have this issue if you used docker as you will upload a container of your site to your host rather than the static filed and database separately.