Using WordPress’ Export/Import function to copy websites
WordPress has a built-in function (or it’s a free plugin) that allows you to export an XML backup of your website and import this into another website. This function is useful for moving websites as long as we know its limitations.
The Export/Import function backs up:
- WordPress pages and menus
- Blog posts and comments
So assume that the function will not backup anything else. Some of the things that I have found the Import will not restore include:
- Website settings (language, timezone, default menu etc)
- Themes (including settings such as the home page, background etc)
- Plug-ins (you’ll keep what you had before the import)
- Pictures, videos and any other media in the wp-content/uploads folder.
Having said this, after I replicate a website to a new site it takes me less than 5 minutes to re-apply the settings that were not included in the XML backup. The next section explains how to transfer our media (pictures, videos and other documents) which can not be transferred using the XML document.
Importing Media content from a live, mirrored website
Contents of the wp-content/uploads folder are not written to the XML document when you use the Export function but the location of these media is included in the backup. When you do an import of the XML document, you have the option of pulling the media from the original website, as long as it’s live and available.
This is one of the reasons I recommend migrating WordPress sites by first creating (or updating) a mirrored, live copy of your original website (we’ll call this Site B) and using this to transfer media to your newly created, moved website (Site A).
Assuming that you have a web host where you have the ability to create sub-domains (to create a backup site) I can now create backup sites of simple WordPress sites (minimal plugins and customisations) in about 20 minutes, so having a backup website sounds harder than it is.
DNS propagation of new subdomain names can delay access to the backup site so I recommend creating mirror sites of your production website hours or days in advance. To take this a step further, I think any business that can not afford to lose its website should seriously consider keeping a live backup site (preferably on another web host) as a matter of course.