This guide describes the process for migrating a WordPress site from a hosted environment to a Synology DiskStation, using a WordPress.org version of WordPress instead of the Synology Package version.
If, like me, you need to run multiple instances of WordPress for different purposes, this process can be used to support that too.
Finally, it can also be used to carry out a one-off installation of the standard WordPress application instead of the official Synology Package Center version. I started with the latter but have now abandoned it, because it takes so long for security patches to be released.
1. When WordPress.org releases a new version, it can take several weeks before the equivalent Synology Package becomes available. Most of the recent updates have been patches for security vulnerabilities so having quick access to updates is important.
2. While the manual installation process for the WordPress.org version is a little more complex than the wizard-driven Synology Package version, it gives you more control over the installation.
- In your WordPress Dashboard go to Plugins > Add New and search for All-in-One WP Migration.
- Install and activate it.
- In the left panel select All-in-One WP Migration > Export and choose Export > File and allow your browser to download it as normal. Make a note of where it is – we will need this file later.
Note that installing phpMy Admin will also install two prerequisite packages, MariaDB 10 and php 5.6, if they are not already installed.
This is a security warning that the phpMyAdmin config file is too freely accessible to anyone who has access to the system which, as this is a web application, is pretty much anyone.
If you see this error you need to look for inherited permissions that are too generous and reduce them to “read only” in File Station. The config file must NOT have write permissions.
1. Download WordPress from wordpress.org
2. Unzip file to a temporary location (or more permanent if you intend to do multiple installations.)
3. Find the folder level in the unzipped folder that contains these items:
4. Copy those items to \web\<FOLDER>, where <FOLDER> represents your chosen name for the subfolder in which the new WordPress installation will be placed.
NOTE: If you have already installed the Synology Package version of WordPress, that will occupy a folder called “wordpress.” Theoretically you could install these files into the root of the /web folder. This is OK if you don’t and never will have other web applications. If you do, then the root folder will become cluttered and it will be difficult to distinguish the apps’ files from each other. And you may change your mind about hosting other apps. Placing the files in a sub-folder will future proof your installation.
Choose a suitable title. In the screenshots that are used in this article I used “wptng” because I was installing both WordPress and an app called TNG. This folder name will not be visible to users, so you don’t need to make it user friendly. Incidentally, it is using different subfolders of \web in conjunction with Web Station that enables multiple instances of WordPress to be installed.
6. Edit the config file to enable direct download of updates. By default the WordPress.org installation does not allow the app to update directly and requires the use of FTP. To change this, use Synology Text Editor to add two lines to the end of wp-config-sample.php
//**The next line allows direct downloads*/ define('FS_METHOD', 'direct');
It’s just easier to get it right first time.
As you can see from the diagram there are different steps depending on whether you have a static IP address (orange route) or not (blue route) and then they converge (grey route)
Static IP Route
You need to logon to your domain host’s cpanel and enter a target destination for your domain / subdomain. Enter your static IP address and save the record.
There are plenty of Dynamic DNS services, some free, some not, offering various services. But we don’t need to look too far because Synology provide their own DDNS service free to all Synology users, and you can set it up directly from your DiskStation.
Here the steps to set up DDNS:
After a short delay while the DDNS service connects, you will see a status like this:
If the status is not “Normal” recheck your settings.
Now you need to go to your domain host site and create a CNAME record for the domain / subdomain, directing it to the DDNS hostname.
- Don’t spend time setting up themes and plugins on the new site. The import process will do all of that.
- You will need to install and activate one plugin – All-in-One WP Migration.
- When the plugin is activated select All-in-One WP Migration > Import
- Drag and drop the file you saved at the beginning of this process and wait while the plugin works its wonders.
- You must go into Settings > Permalinks, check they are correct and save the page TWICE to make them stick.
- Check the site is working to your satisfaction. For example:
- Are your themes and plugins installed and active?
- Do theme elements work as anticipated?
- Are posts and pages present and working?
- Have your user accounts transferred across?
- Do not delete your hosted content just yet. If it turns out something is wrong with the local site, you only have to change the DNS entry to point to the hosted site to bring that back-online.
- If appropriate, don’t forget to re-enable your computer’s sleep mode.
Now that your site is hosted on your DiskStation the obvious solution is Synology’s Hyper Backup if, that is, you only have a single WordPress installation.
1. Check your backup settings to make sure that all folders and applications added by this process are included. Hyper Backup doesn’t include new items by default, you have to explicitly include them.
2. Don’t forget to disable and remove any backup plugins from the new site.
If you have multiple WordPress instances then you will need a different backup method. WordPress content is stored in the Maria database and without performing some wizardry you can’t do selective restores. So if you need to restore one WP instance to solve a problem you will have to restore them all, which is an issue if you have added content to the other sites since the date you need to restore from.
There are several backup plugins, but one of the most popular is Updraft. Do a search in the plugins library. If you splash some cash you can get a version that includes a central dashboard for managing your separate sites.
I hope you found this guide useful.