To set up free scheduled backups for your WordPress blog hosted on a self-hosted plan with HostGator, you can use a combination of plugins and manual methods to automate the backup process without incurring extra costs. Here are a few free methods you can use:
1. Use a Free WordPress Backup Plugin
There are several free WordPress plugins available to automate scheduled backups. Some of the most popular options include:
UpdraftPlus
- Description: UpdraftPlus is a highly rated backup plugin that allows you to schedule backups and store them remotely for free. It supports backup to services like Google Drive, Dropbox, and others.
- Steps to set it up:
- Install UpdraftPlus: Go to your WordPress dashboard, navigate to Plugins > Add New, search for “UpdraftPlus,” and click Install Now and then Activate.
- Configure Backup Settings:
- Go to Settings > UpdraftPlus Backups.
- In the Settings tab, set up the Backup schedule for both your files and database.
- Select a remote storage option like Google Drive or Dropbox to store your backups for free.
- Schedule Regular Backups: Choose how often you want backups (daily, weekly, etc.) and how many backups to retain.
- Run a Test Backup: After configuration, run a test backup to ensure everything works as expected.
BackWPup
- Description: BackWPup is another popular free plugin for scheduling WordPress backups. It allows you to back up your entire WordPress site and export it to various remote storage options.
- Steps to set it up:
- Install BackWPup: Go to Plugins > Add New, search for “BackWPup,” then Install and Activate.
- Configure Backup Job:
- Go to BackWPup > Add New Job.
- Select the backup type, which can include database, files, or both.
- Set the schedule to run the backup periodically (e.g., daily, weekly).
- Choose a remote destination like Google Drive, Dropbox, or FTP to store your backups.
- Run the Backup: After configuring the settings, run the backup manually the first time to confirm everything works properly.
Duplicator
- Description: Duplicator is a well-known plugin for backing up and migrating WordPress sites. While it doesn’t have an automatic backup option in the free version, you can set up a manual backup schedule.
2. Use cPanel’s Backup Features (If Available)
HostGator provides access to cPanel, where you can back up your website files and databases manually or via scheduled tasks (cron jobs). However, you would need to use a script or the cPanel’s Backup Wizard for scheduling.
Steps to schedule backups with cPanel:
- Create a Backup Script:
- You can create a simple bash script that backs up your WordPress files and database, then stores them in a specified folder.
- Example of a simple backup script:
#!/bin/bash # Backup WordPress files tar -czf /home/username/backups/wp-files-$(date +\%F).tar.gz /home/username/public_html # Backup MySQL database mysqldump -u db_user -p'password' db_name > /home/username/backups/wp-db-$(date +\%F).sql
- Create a Cron Job:
- Log in to cPanel and go to the Cron Jobs section.
- Set up a cron job to run the backup script at the desired frequency (e.g., daily, weekly).
- You can enter the following cron job to run the script daily at 3 AM:
0 3 * * * /bin/bash /home/username/backup-script.sh
- Store Backups: Make sure the backups are stored in a separate location to prevent overuse of disk space.
3. Manual Backups via FTP and phpMyAdmin
While not fully automated, you can regularly back up your WordPress site using FTP and phpMyAdmin (for the database) manually.
- Step 1: Use an FTP client like FileZilla to download your website’s files from the public_html directory.
- Step 2: Export your WordPress database using phpMyAdmin in cPanel.
- Go to phpMyAdmin, select your WordPress database, and click on Export to download the database as an SQL file.
- Step 3: Store these files in a secure location (on your computer or a remote server).
4. Use Cloud Storage for Backups
If you prefer storing backups off-site (which is recommended), consider using free cloud storage services like:
- Google Drive (15 GB free)
- Dropbox (2 GB free)
- OneDrive (5 GB free)
You can connect these cloud services with your backup plugin (like UpdraftPlus or BackWPup) to automatically store your backups in the cloud.
5. Backup Notifications and Testing
For each backup method, set up notifications (where available) to inform you if the backup succeeds or fails. This ensures that you’re always aware of the status of your backups.
- Test Backups: Regularly test your backups by restoring them in a staging environment to ensure the process works correctly.
By using free WordPress plugins like UpdraftPlus or BackWPup, you can set up automated backups with minimal manual effort and store them remotely. For more advanced options, you can utilize cPanel cron jobs to schedule backups via scripts, or opt for manual backups as a fallback.