Automate Your Website File and MySQL Backups

Part 1 – Prerequisites

Backing up your website files and databases is one the most important things a website owner can do. In this article, I’m going to show you a method of automating backups of your website files and MySQL databases. Then we will use WinSCP to automatically retrieve those backups and store them on your local computer on an automated schedule.

There are a few prerequisites to this method:

  1. Your website needs to be hosted on a linux based server
  2. You need to be able to create cron jobs on your web server
  3. You need an FTP/SFTP account set up on your web server
  4. You will need to download and install the free program WinSCP
    • You can get it here.
  5. You need a Windows computer with access to the Windows task scheduler

It is best to use SFTP instead of FTP if your web host supports it (most should).  Although FTP can be used, SFTP is highly recommended for security reasons.

Anywhere you see certain words highlighted in red bold italic text throughout this article, you need to change for your custom situation as follows:

CpanelUsername = The username you use to log on to your web hosting control panel.
MySQLusername = Your username to access your MySQL database.
MySQLpassword = Your password to access your MySQL database.
dbXname = The name of your database.
SFTPUsername = The username for your SFTP account.
SFTPPassword = The password for your SFTP account.
SFTPport = The port you use for SFTP (usually 22, sometimes 2222).

Document Root: This article assumes that the path to your public web directory (AKA document root) is “/home/CpanelUsername/public_html”. This may not be your actual case, depending on your web host. If this is not your path to document root, you will have to replace every instance of “/home/CpanelUsername/public_html” with your actual path to document root. If you are not sure what your path to document root is, you will need to check with your web hosting provider.

Next page – Backing up your databases.

This entry was posted in Website Administration, Website Backups and tagged , , , , . Bookmark the permalink.

11 Responses to Automate Your Website File and MySQL Backups

  1. Ryann Lalata says:

    I am glad to finally learn this. Thanks!

  2. Sounds very intersting.This helps me to learn something new.Thanks.

  3. Gena Nett says:

    Terrific, this information is exactly what I was searching for.

  4. Your Article is Very HelpFull , Thank you very much

  5. Pretty nice post. I just stumbled upon your blog and wished to say that I’ve truly enjoyed browsing your blog posts. In any case I will be subscribing to your rss feed and I hope you write again soon!

  6. I’ll be sharing this with my network. Very pleased with your style, thanks! I will come here again.

  7. Helpful information here. I added your site on my favorite, so visit again.

  8. I have to tell, that this article is great! Thanks for providing the such a wonderful article, you have assembled a tremendous amount of useful data here. So thanks again.

  9. Bobbi Carey says:

    What a great post

  10. Simply wanna input that you have a very nice site, I love the pattern it really stands out.

  11. humanizer says:

    There are a few excellent suggestions here. I need to renovate my own blog site a while. My goal is to begin from the start these times I think.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Proudly powered by WordPress.
preloaded image preloaded image preloaded image preloaded image preloaded image