Wordpress Database Backup PHP Script


If you are using WordPress and in need of an efficient backup solution of your database. You can download PHP script

Download this file

To implement this script:

1.) Download first to your local computer.

2.) Unzip the script.


3.) Read the instructions inside the script. It would be definitely helpful for you.

4.) Define the WordPress MySQL database username, password, hostname, etc.

5.) Define the full server path to the wordpressmysqlbackup folder. This path SHOULD be above the webroot (html, public_html or www folder in your hosting account) so that it won’t be accessible with a web browser.

6.) Define how many days you wish to delete the old backup. The script contains some rules regarding that, so you need to read that section.

7.) Upload the wordpressmysqlbackup.php to the path defined by $full_serverpath_to_backup variable.

8.) Configure your cron to execute that script depending on your need. If you need to generate a backup of your MySQL database weekly, then run your cron weekly. Consult your hosting support on how to run cron.

9.) Download the database securely using SSH. It is advisable to keep at least two copies of your database in your local computer: the old one and the new one. The old one will be deleted by the server, but you should have a copy of it in your local computer.



Related posts: