MySQL Database backup from shared Server to local  Machine / Network

Posted on 2012-08-31
Medium Priority
Last Modified: 2012-09-04
I manage several web applications that make use of MySQL databases.

Most of these are hosted by GoDaddy or 1 & 1.

I recognize that the databases are backed up by the hosting company on a regular basis.

In several cases we want to institute a process where our database is automatically backed up  on a regular basis (daily, weekly). I envision a chron job running on the web server backing up the database. But I want to extend the process so I can download (automatically) to a local machine or network the completed backup (zipped) .

What are the best ways to do this?

Question by:Richard Korts
LVL 18

Accepted Solution

Garry Glendown earned 2000 total points
ID: 38356757
Well, to get the data exported is a simple, one-step solution ... just use "mysqldump", e.g.

mysqldump [-A] -p PASSWORD -u USER [database] >dump.sql

Use either -A to dump all databases available to the user, or name the database you want exported as an argument.

The Cron script can then compress the output-file:

bzip2 dump.sql

resulting in the file "dump.bz2" (any other compressor will of course also work)

To automatically download the file, there's multiple options, depending on your setup. If you have a server that has a public IP address, you could set up either a remote copy using a plain FTP upload (you may want to encrypt the data before transferring with FTP), or use scp (requires a key auth in order to transfer); if you do not have a public IP, you could turn it around, retrieving the backup files via scp ...
LVL 11

Expert Comment

by:Pradeep Dubey
ID: 38357623
I suggest you to take a look of below backup solution:

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft will be releasing the Windows 10 Creators Update in just a matter of weeks. Are you prepared? Follow these steps to ensure everything goes smoothly and you don't lose valuable data on your PC.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
Suggested Courses

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question