Jump to content

Get dump of MySQL DB from Live Site


Omzy

Recommended Posts

I'm after an easy, but secure way of generating and importing a MySQL dump from a remote server.

 

The way I want to achieve this is as follows:

 

1) I will have a page on my localhost server with a form that submits to a script on the live server

2) The script on the live server receives the request and beings to generate the dump data

3) Once generated it sends back this data to a script on my localhost server

4) The script on my localhost server receives the data and runs the queries

 

What methods can be used to achieve this? I know possibly the easiest method would be to just POST the data in a hidden form variable, but I'm not too convinced this is secure.

 

I've heard I can use XML as an alternative option, but not too sure about this. Anyone got any suggestions?

Link to comment
https://forums.phpfreaks.com/topic/190158-get-dump-of-mysql-db-from-live-site/
Share on other sites

My method is slightly more complicated, but a lot more secure. You'll need a script for generating the dump, a script for activating the backup and a script for receiving the backup (listen).

 

1. user loads up the form page and clicks submit (or whatever you want them to do to trigger it)

2. The live server starts to generate a backup

3. once the backup is generated the live server sends the backup to the "listen" script on your backup server

4. The listen script then runs the query.

 

For example:

 

website1.com/form.php -> user clicks "generate backup" -> request sent to "website2.com/dump.php" -> website2.com/dump.php generates a sql dump -> website2.com/dump.php sends the dump to website1.com/listen.php -> website1.com/listen.php runs the query.

 

This means the user will never see the data, it'll all be transfered behind the scenes. Apologies if I explained it poorly, this is a graphic created by Paypal that shows how I mean: https://cms.paypal.com/cms_content/US/en_US/images/developer/IPNOverview.gif

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.