Our scenario is a local Linux MySQL server on which we can do whatever we want including installing stuff and setting up cronjobs, and a remote one which we can access only via PHP. The remote one is the usual LAMP hosting service so we can upload whatever PHP we want but only the php scripts themselves from localhost will be able to connect to MySQL, we can't directly connect to the db from outside. There is FTP to upload and manage PHP files.
The local server runs some business software, and we wrote scripts to get some data from that software. We need to load that data up in some dedicated tables on the website MySQL hosted somewhere else.
For testing purposes we exported the local db (using a local phpMyAdmin) and imported it on the remote system (using the remote phpMyAdmin), of course it works fine. Now we need to automatize this.
Our "synchronization" is actually a full erase of the remote end and then we re-import everything from the local db. This is gonna happen every night.
The first idea is a local cron job that exports via mysqldump, uploads via FTP, wget's a remote php file URL that (after some credentials checking) finally runs the uploaded SQL. Sort of blind, stupid script... should work well as long as I keep strangers outside of the SQL upload / SQL import area.
Rather than re-inventing the wheel, is something out there that could achieve the same result, maybe in some more intelligent way that I'm not thinking of?
thanks.