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
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

Link to comment
Share on other sites

This means the user will never see the data, it'll all be transfered behind the scenes.

 

ok...

 

Why not run a replication then?

 

I understood it was for backup purposes only, not to tranfer data between websites.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.