If you are a WordPress user, then you definitely
know the importance of keeping backup copies of the Wordpress files because
there is always a risk of losing your data. Sometimes your site might get hack,
and then you could lose all the files and databases. That’s horrible, right?
There are a lot of ways to secure your WordPress site, but I still think one of
the best way is to backup regularly so that you can re-install your files or
content and roll backed to your post in no time.
First of all, let’s learn about WordPress Files,
all the WordPress
sites consist of the following files:
Ø WordPress
Core Installation
Ø WordPress
Plugins
Ø WordPress
Themes
Ø Images
and Files
Ø Javascripts,
PHP scripts, and other code files
Ø Additional
Files and Static Web Pages
Accessing WordPress Files and Directories
First, you will need a FTP client to connect
to your WordPress server. An easier alternative to FTP is File Manager. It is a
web based application that comes built into cPanel dashboard of your WordPress hosting account.
Once you have connected to your WordPress site
either using FTP or File Manager, you will see a file and directory structure
that looks like this:
Files and folders in the red squares are the
core WordPress files. These are the files and folders that run your WordPress
site. You are not supposed to edit those files on your own.
Here is a list of core WordPress files and
folders you would see in your WordPress site’s root directory.
WordPress Configuration Files
Your WordPress root directory contains some special
configuration files. These files contain important settings specific to your
WordPress site.
Ø .htacces – A server
configuration file, WordPress uses it to manage permalinks and redirects.
Ø wp-config.php –
This file tells WordPress how to connect to your database. It also sets some
global settings for your WordPress site.
Ø index.php
– The index file basically loads and initializes all your WordPress files when
a page is requested by a user.
If you don’t see .htaccess file in your root
directory, then checkout our guide on why you can’t find
.htaccess file in your WordPress root directory.
Depending on how your WordPress site is setup,
you may or may not have the following files in your root directory.
Ø robots.txt
– Contains instructions for search engines crawlers
Ø Favicon.ico
– A favicon file is sometimes generated by WordPress hosts.
Inside
wp-content Folder
WordPress stores all uploads, plugins, and themes in
wp-content folder.
It is generally assumed that you can edit files
and folders inside wp-content folder. However, this is not entirely true.
Let’s take a look inside wp-content folder to
understand how it works and what you can do here.
The contents of wp-content folder may differ
from one WordPress site to another. But all WordPress sites usually have these:
Ø [dir]
themes
Ø [dir]
plugins
Ø [dir]
uploads
Ø index.php
WordPress stores your theme files in /wp-content/themes/ folder.
You can edit a theme file, but it is generally not recommended. As soon as you
update your theme to a newer version, your changes will be overwritten during
the update.
How to Backup Your WordPress Files?
#1. Backup
WordPress Manually
WordPress is a web application based on PHP and
MySQL. As such you need to backup all its files and its database to have a full
copy of your site. The easiest way to copy your files is via FTP. To do this
follow the instructions in our tutorial on how to use FTP. Make sure that
you save all the files and folders in the directory WordPress is installed in
(public_html if it's the main application for your site).
#2.Website Host
Provided Backup Software
Most website hosts provide software to back up
your site. Check with your host to find out what services and programs they
provide.
#3. Create
Synchs With Your Site
WinSCP and
other programs allow you to synchronize with your website to keep a mirror copy
of the content on your server and hard drive updated. It saves time and makes
sure you have the latest files in both places.
To synchronize your files in WinScp:
Step 1 - Log in to your ftp server normally using
WinScp.
Step 2 - Press the "Synchronize" button. Remote
directory will automatically be set to the current ftp directory (often your
root directory). Local directory would be set to the local directory as it was
when you pressed Synchronize. You may want to change this to some other
directory on your computer. Direction should be set to "local" to
copy files FROM your web host TO your machine.
Synchronization Mode would be set to Synchronize files.
Synchronization Mode would be set to Synchronize files.
Step 3 - Click "OK" to show a summary of
actions.
Step 4 - Click "OK" again to complete
the synchronization.
#4.Use WordPress
backup plugins
These plugins are used to take a back up of your
critical data, files, tables and save them to your archives or any of the
online storage for free or for a nominal price. Schedule the storage
automatically and manage your entire database with these.
If you regularly update your site, then it
wouldn’t be possible to always keep your backups up to date. This is where
BackupBuddy comes in. It is a WordPress backup plugin, which allows you to
automatically create complete backups of your WordPress site and save them on
multiple remote locations like a cloud storage service, your computer, FTP
server, etc.
WP-DB-Backup plugin creates a backup of your
core database tables and also other tables in the database and gives you an
option of saving your back up data either to your server or download to your
computer or save get you backup file e-mailed to you.
BackUpWordPress will back up your entire site,
including your files and your database, at a schedule that suits your needs. It
requires no setup and works on low memory – an excellent advantage if you’re
operating on a shared host environment. The plugin also gives you the option to
use zip and mysqldump for faster backups. That can be a significant benefit if
time is of the essence.
This plugin offers an automated backup solution
directly to Dropbox, if that’s your tool of choice for online file storage. However,
blogVault requires some setup, though the documentation claims that the setup
is “easy” and that it will require a minimal investment of your time.