Migrate a WordPress Site to a Synology NAS

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.

This guide leans heavily on the material produced by Steve Davis on his site. If something in this guide doesn’t work for you, post a comment here or head over to Steve’s site for a more advanced, technical explanation.

As always, please make sure you have backed up your DiskStation before you start.

To be certain that critical processes are not interrupted, please make sure sleep mode is not enabled on your computer.

You will be installing the generic version of WordPress available from WordPress.org instead of the Synology Package version.  Why?

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.

Assuming that you have none of the components that we need installed, we will start with the basics.  If you already have some of the components installed please read each section just in case there are some additional things that need to be done.
  1. In your WordPress Dashboard go to Plugins > Add New and search for All-in-One WP Migration. 
  2. Install and activate it.
  3. 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.
The free version of the plugin has a file size limit of 512MB. If your compressed file exceeds this limit you will need to purchase an extension to enable unlimited file sizes. The extension is not cheap ($69 at the time of writing) but that cost is comparable to other alternatives, is a one-time cost, and can be used on multiple sites. It’s also a brilliant plugin that does exactly what it says on the tin and will save you masses of time. It is one of the most downloaded plugins (Over one million installs.)

1. Create Web Share

2. Set Permissions

Each of these applications is installed from Synology’s Package Center.   It’s only WordPress that is not.

Note that installing phpMy Admin will also install two prerequisite packages, MariaDB 10 and php 5.6, if they are not already installed.

If the permissions granted in the previous step are too generous, phpMyAdmin will not open, and will return an alarming error that the config file must not be world writeable.

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.

5. Set permissions for new folder, subfolders and files

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');

Courtesy SKDavis.net

It may seem premature to redirect traffic before we have even installed the app, but the WordPress installation process defaults some address settings to the URL that is used to perform the installation.  If you run the process from a LAN IP then that is what will be embedded in the default settings, and your WordPress installation will not be externally accessible until you edit those settings.

It’s just easier to get it right first time.

Residential customers may not be able to obtain a static external IP address from their ISP.  A static IP has advantages if you want to run a Mail Server, and having one makes it slightly easier to set up access to a web service on your DiskStation.  If you can’t or don’t want to get one  you can get round the problem by using a DDNS service, which is constantly updated to reflect your current external IP address.

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.

DDNS route

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.

In your browser, enter <Virtual Host Name>/wp-admin
  1. Don’t spend time setting up themes and plugins on the new site.  The import process will do all of that.
  2. You will need to install and activate one plugin – All-in-One WP Migration. 
  3. When the plugin is activated select All-in-One WP Migration > Import
  4. Drag and drop the file you saved at the beginning of this process and wait while the plugin works its wonders. 

Your new local site will be overwritten with the hosted site’s contents and the URLs will be adjusted to the new location. This includes user names and passwords, so when you login to the new site you must use the credentials from the hosted site.

  1. You must go into Settings > Permalinks, check they are correct and save the page TWICE to make them stick.
  2. Check the site is working to your satisfaction. For example:
    1. Are your themes and plugins installed and active? 
    2. Do theme elements work as anticipated?
    3. Are posts and pages present and working?
    4. Have your user accounts transferred across?
  3. 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.
  4. If appropriate, don’t forget to re-enable your computer’s sleep mode.
In a hosted environment you may have been using a plugin such as X-Cloner or something similar to backup your site.  Perhaps your host provided some backup tools?

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.


Paul Barrett

  1. Wow!!! ….After 2 days of hitting my head against the wall trying to get the synology wp package accessible from external network and constantly getting the infamous blue dsm screen, I followed your simple guide and had a working website up and running within an hour. Why oh why didn’t I find your blog sooner??…… Many thanks

  2. Thanks for this useful guide. After exporting my WordPress content with the All in One Migration plugin I got this message:
    “Document not readable
    The document at /wp-content/ai1wm-backups/lawandrevolution.com-20180925-041147-116.wpress cannot be read by the server. (More information)”
    The “more information” is a hyperlink that takes you here:
    Any thoughts on how best to proceed?
    Thanks much for your advice.

  3. This is a permissions issue. The linked article talks about using Linux commands which you could do in Synology by using shell access. But that is a bit of a black art for novice users.

    You can achieve the same by using File Station. Navigate to the folder aiwm-backups and take a look at the permissions (right click the folder the choose permissions). If they are greyed out go the advanced button and select the option to make the inherited permissions explicit.

    Now select the SYSTEM user and Edit the entry. Grant Read/Write permission but remove the delete option. Do not allow Administrator access.

    Try again. If unsuccessful grant the same permissions to the group “users” and try again. If still not successful, apply same permissions to “http”

  4. Great!It`s helps a lot!!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>