I have two lamp stacks that are remote to one another. I have to send the results of a query from stack one to a table on stack 2. I'm not sure what the best method is to use.
I have considered setting up an API but am not sure if this is the right application for an API. I have considered, having stack one export a sql dump and the other server download then import, but this feels very insecure. Any advice would be greatly appreciated.
I ended up solving this problem with rsync. I have the first lamp stack dump the data to a file then open an rsync connection to the second server and have a cron running the import 2 hours after the rsync is set to connect. The cron also unlinks the file once the import is complete. Not perfect but the job is complete and I feel I didn't open up any security issues.
Transfering the results of a query from lamp stack to another