In my last post, I wrote about the 5 plugins that are used the most in the community to backup and restore WordPress websites. Out of the 5, I’d mentioned that my choice of backup tool was Duplicator Pro. Today, let’s take a deeper dive into it and understand how can Duplicator Pro be used to achieve that. By the way, there is also a free version of the plugin that is perfectly usable. The extra features you get out of the Pro are:
- Save the backups on external storage, like AWS, Google Drive and Dropbox. As I’d mentioned in the last post, it’s quite important for the backup strategy to make backups offsite.
- Schedule automatic backups, instead of having to manually backup every time.
- Create a new WordPress installation, in addition to replacing an existing one. The latter is possible with the free version.
If you wish, you could take a look into a detailed comparison between the Free & the Pro plans.
Steps to Backup WordPress website
- Download either the free or Pro version of the plugin.
- Install them on your WordPress website.
- Navigate to the menu item titled “Duplicator (Pro)” on the sidebar
Steps to set up target storage options for your backups
The very first step in the process will be to set up the target location where your backups will be saved. This is just setting up templates for each storage solution. The actual target location for every single backup will be chosen at a later stage. What I’d suggest is to set up all potential backup locations at this stage.
- At the Storage option page, click on the
Add Newbutton at top right.
- Specify a
namefor this template, add some notes (optional) and choose the destination location.
- Add the path to the folder where you’d like the backup to be saved. This path needs to be filled out irrespective of which storage location is chosen.
- Click on the
Setting up the Backup Template
Before we start backing up the website, it’s a good idea to set up a few templates that will decide how will the website be backed up, where, and while files/folders should be included/excluded from the backup. Setting up a few templates with these options is super helpful in saving time later on, when we actually plan to backup.
- Navigate to
- Click on the
Add Newbutton at the top right.
- You can use the
copy fromoption to copy settings from another template, or simply proceed to create a new one.
- Provide a name ot the template and add some notes, if you prefer.
- In the
Archivessection, fill up the options you’d like. Here’s a copy of he settings I use, personally.
- Click on
Save Templateand you’re done.
How to schedule a backup
Here’s a quick screen recording to explain how a backup schedule can be set up using the template we just created.
Migrate the WordPress Website to another host
Find & Transfer the Package Files
- Once you’ve created at least one backup of your website using the above method, you’ll find the files listed under
- Choose the backup package, and click on the hamburger menu on the right.
- Off the options you get, choose
- From the details page, click on the link and download these 3 files:
- Copy these 3 files to either a folder in your local computer, or a publicly accessible folder at your new host. Put the package files in one of the following locations depending on where website files reside for the site you are installing:
/public_html/[site package files here]
/public_html/my_addon_domain/[site package files here]
/public_html/my_subdirectory/[site package files here]
Edit Destination Server’s Hosts File
This step only applies when moving hosts, while keeping the same domain. Otherwise, skip this step.
The hosts file maps a host name to an IP address. This allows you to override which server is hit when you browse to a site. What we want to do is trick our development machine (machine running the browser) into thinking the domain resides on your new server before the DNS has switched.
This is important because it allows us do the real domain switch only after the install and things have been confirmed working – allowing us to avoid any downtime.
- Determine the IP address of the new server. Log into your host to see what the IP address of your new server is. You’ll be able to determine this directly or may need to talk with your host support.
- Load your development machine’s host file. Please refer to this article on how to edit the hosts file on your particular operating system.
- Change the hosts file. Go to the bottom of the hosts file and enter something a line in the form “the_ip_address your_domain_name”. For instance, if my new server’s IP was 22.214.171.124 with domain name mydomain.com, I would add
- After you’ve edited your hosts file you’ll have to flush the DNS on your machine. This is required to ensure that your development machine serves up the correct IP when asked since the old name to IP mapping may be cached.
Time for the Magic — Installation Wizard
Finally, we can install to the site using the installation wizard.
- Browse to the installer on your site (http://yoursitename.com/<random_numbers>installer.php) to start the installation process.
- Choose if you are creating a new or connecting and removing data from an existing database. In most circumstances you will choose the second option since you are installing to an already created database (creating a new database only works when you install to localhost).
- Fill in the necessary information to connect to the database. Note: If you are overwriting an existing site, you will be asked if you want to reuse the database credentials from the existing site. Keep in mind that database will be erased.
- There are additional advanced options which we won’t cover in-depth here, but they involve things like manual extraction of the archive which comes in handy if your server has a hard time processing larger packages with the installer and many others.
- Click the
Run Deploymentbutton to kick off the installation process.
- After a period of time a second screen pops up which informs you about which URL and path information is being swapped out. Once you are satisfied you may continue and finish the install.
Change Domain Servers
If you moved a domain between hosts you may now switch the name servers to the new host and remove the entry made in the hosts file above.
I have been quite impressed by Duplicator Pro until now, and competes very closely with All-in-One WP Migration for simplicity, when it comes to migration. Where it wins hands down is its extensive options of backing up and scheduling.