21
Nobody likes to lose files. Losing a WordPress blog can be devastating. Sometimes, it can mean hundreds, if not thousands of hours lost — all with the crash of a server. Of course, if you backup your files, that won’t be a problem. Backing up anything can be a hassle, but after scheduling automatic backups, you won’t even need to worry about it!
Backing up a WordPress blog is a two part process. The database and files need to be backed up. Each one must be done separately, but both can be scheduled. The first part, backing up the database, only requires a WordPress plugin, while the second part, backing up the files, requires some software.
Database
Backing up the WordPress database requires a plugin called WP-DB Backup. Follow the instructions below to install it.
- Copy the wp-db-backup.php file to /wp-content/plugins/
- Activate the plugin at your blog’s Admin > Plugins screen
- The plugin will attempt to create a directory /wp-content/backup-*/ inside your WordPress directory.
- You may need to make /wp-content writable (at least temporarily) for it to create this directory.
Once installed, go to your blog’s admin panel, and configure the plugn’s settings at Manage > Backup. Make sure all the tables are selected. By default, the plugin backs up core WordPress tables, but if you’ve installed other plugins, there may be more tables. The “Backup Options” section allows you to manually backup the database.
But we want to schedule automatic backups, so scroll to the bottom of that page, and find the section labeled “Scheduled Backup.” Once again, check the extra tables (if any). Next, enter your email address and choose how often you want to backup. I’d recommend a day, but it depends on how often you post. If you post a few times a day, hourly, or twice daily, might be better. Hit “Schedule Backup,” and hope that everything goes fine. Scroll back down to “Scheduled Backup,” and see when the next backup is scheduled. From then on, you will automatically get emails with your database attached. If you use Gmail, create a filter to label the messages. When creating the filter, put “Database Backup” as the subject. You may want to set Gmail to automatically label the messages as read, and skip the inbox.
Files
Backing up the files is the second part of the process. If your only back up your database, you could lose your images, themes, plugins and more. Unfortunately, backing up the files can’t be done through WordPress, so it varies by operating system.
On Windows, create a folder where you want to save the files. You should create a few subfolders for daily, weekly, bi-weekly, and monthly backups. Then, download and install SyncBack, a free backup utility for Windows, and run it. Create a new profile, chose backup as the type, and call it “WordPress Backup – Daily,” or something like that.
Be careful when setting up the profile. A small mistake could cause you to lose everything.
First, click on expert, and go to the FTP tab. Check the box that says, “The destination directory is on an FTP server,” and enter your FTP details. Test the FTP settings, to see if it works. Next, click on the folder icon next to destination (at the top of the window), and you’ll receive a message asking if you want to connect to the FTP server. Say yes, browse to your WordPress directory, and hit OK.
Now, for the source, click on the folder icon next to source, and browse to the folder you want to backup to. Since this profile is for daily backups, make sure to select the daily backup folder you’ve already created.
Next is the confusing part. Logically, the FTP server should be the source, but SyncBack does not allow this. So, since the FTP server is the destination, you want to get the files from the destination to the source. Go to the advanced tab, and look over the settings. There are three boxes. The first one asks “What to do if the same file had been changed in the source & destination?” Select “Destination overwrites source always (restore).” This will make sure that files from the FTP server take priority over the local files (after all, we don’t want to synchronize the files). The second question asks “What to do if a file is in the source but not in the destination?” Choose “Delete file from source.” This ensures that you don’t have any old files on your computer that aren’t on the server. Finally, the third question asks “What to do if a file is in the destination but not in the source?” Click on the option that says “Copy file to source.” This will copy the files from your FTP server to your computer.
The profile is basically set up, but, to get it to run automatically, go to the background tab. Since this is a daily backup, click the box that says “Run this profile every” and select one day as the time. Hit OK.
Preform a simulated run of the profile. Make sure you understand everything it says. We are not responsible for any lost files, so run the profile at your own risk. If everything was set correctly, it will run fine. Set up the other profiles (for weekly, bi-weekly, and monthly backups) the same way you set up the first one, only changing the source folder, and how often it runs.
If you use a Mac, things become more difficult. Unfortunately, SyncBack is only available for Windows. Software such as Panic’s Transmit can automate FTP backups, but many of those aren’t free. While I haven’t tried this, in theory, you could mount your FTP server in finder (open finder, then select “Go > Connect to Server” in the menu bar), and use Automator to copy the files. If anyone has any tips, leave a comment.
Conclusion
Well, there you go. Everything is backed up. Doesn’t that feel good? Learn how to restore a WordPress site here at doDesign. Hopefully everything works out!



[...] or 1-Click Backups and Simple Restore I wrote a tutorial that explains how to schedule automatic WordPress backups. Sure it works, but it takes time to set up. It would be very nice if this was a default [...]
I’ve had your blog in my bookmarks for a couple of days now and just wanted to say that I really love your articles! ^^
How do I save the backup settings? I configured the settings and backed up my files to my email. However, when I went back in to tools>backup, the default settings appeared.
Hi, make sure you are changing the settings at the bottom of the page labeled “Scheduled Backups.” You might have configured the settings at the top of the page (which let you send the backups manually).
and file backup in linux?
Hi gang,
For other backup options – try Super Flexible FIle Synchronizer at http://www.superflexible.com. It isn’t freeware, but it’s so good and so cheap that it hardly matters when you’re talking about backups.
I’ve been using it for years to run scheduled mirror backups of my main data drives every night, and I just discovered it can also run FTP backups from a web server to your local machine / other server / network file share / etc.
It’s a VERY good piece of software. It also works on Mac & Linux. (Although Linux version is 2004 version I believe… check their site for updates.)
Hope this helps you all
Best,
Israel.
Thanks for this helpful post. I’m going to add the plugin and run backup for my site now!
This is a great article and a :::huge::: help, thanks!
My site on BlueHost has all WP within the public_html folder. I was thinking that I only need to set this to grab the contents of that folder, and not folders outside of public_html, like htaccess and log files and whatnot. Would you agree?
Yeah, that’s all you need. Glad you liked the article!