EDIT – As of March 2016 and the advent of DSM 6.0 these instructions are no longer relevant. Please use Synology’s new Hyper Backup replication feature.
The following are step by step instructions on how to perform the first copy of data from one Synology NAS to another via the Time Backup application with the goal of later installing one device remotely for scheduled incremental backups.
The Task: Two Synology DSM 5.1 devices are to be paired with the Time Backup service so that one local device copies any new data (incremental) every night to the remote device installed off-site. Normally the nightly incremental data transfers are not a lot of data, just any files that have been changed or added that day but the first copy or seed of the two devices is a lot of data and could take weeks to accomplish over the internet when encrypted transfer is enabled. If the initial seed is interrupted, it has to be started again from scratch. The logical solution would be to accomplish the initial data seed while the two Synology NAS are side-by-side on the same local network. But due to a limitation of Synology DSM 5.1 this is not easily accomplished.
The Problem: When both NAS are installed on the same local network and the initial Time Backup task is created, you must define the location of the remote NAS. Even if you input a fully qualified public domain name such as remote.snaz.synology.me it will still return the local netbios name with the local IP of the remote device such as REMOTE-SNAZ(192.168.1.15) but this cannot be changed later and will cause the Time Backup task to fail when the remote NAS is moved off-site.
The Solution: By editing the local NAS hosts file we can prevent the device from using the local Netbios name during the initial seed. After the local seed is completed and the remote NAS is installed off-site the hosts file on the local NAS is reverted to default and it will then query the public internet DNS servers to find the remote NAS. The scheduled incremental backups will now continue automatically. Huzzah!
- You need to have at least the remote device registered with a DDNS (Dynamic Domain Name Service) such as the free MyDS service provided my Synology. You could also register it with your own domain, the goal is to have the device publicly addressable via a hostname. In these instructions the local and remote NAS are registered repsectivly as local.snaz.synology.me and remote.snaz.synology.me You can sign up for the free Synology DDNS service here. You will need to open the ports on your routers as per the usual instructions from Synology for setting up Time Backup.
- This next step will illustrate how to edit the hosts file on the local NAS. WARNING – EDITING FILES ON THE NAS COULD HARM YOUR DEVICE – I AM NOT RESPONSIBLE. YOU HAVE BEEN WARNED.
- We need to prevent the local NAS from using the Netbios name and IP address of the remote NAS when it is installed locally, this is accomplished by creating an entry in the hosts file that maps the external hostname of the remote device to the temporary local IP address. Once the data seed is completed and the remote device is installed off-site, the changes to the hosts file are reversed so that the local NAS can query the Internet to find the remote device normally.
- Enable SSH/Telnet in Control Panel.. Terminal & SNMP. Download and install the free SSH tool PuTTY from here: http://www.putty.org/
- With PuTTY log into the Local NAS via is it’s local IP. Username must be root and the password is your admin password.
- Type cd /etc <press enter>
- Type cp hosts hosts.bak <press enter> This makes a backup copy of the hosts file which can be used in case you make a mess of the hosts file.
- Use the built in file editor vi to edit the hosts file, see here for vi instructions if needed.
- Type vi hosts <press enter>
- The vi editor should load the un-edited hosts file and look something like this:
- Press the <INSERT> key on your keyboard to begin editing, use the arrow keys to navigate to end of the last line and press the <ENTER> key to begin a new line, sometimes the last character gets cut-off, clean this up before saving.
- On the new line type local IP address of the remote NAS followed by the external hostname, see below. This hostname is the external name that identifies the remote device on the Internet, in my example I am using the Synology.me DDNS service. If you make a mistake and want to try again, quite vi without saving by typing <ESC> key :q! <press enter>
- Once the hosts file has been edited, save by typing <esc> key :wq!
- Test by pinging the external hostname, you should get the local IP you defined in the hosts file as a response. Example: Type ping remote.snaz.synology.me <press enter> Stop the pings with <CTRL> + C. The local NAS is now ready for the initial seed with the two devices side-by-side on the same local network.
- Create the Time Backup task on the local NAS using the public hostname defined earlier as the destination. No need for transfer encryption at this point as it is not needed and will dramatically slow down the data transfer. After the initial seed is complete, try another backup and confirm the incrementals are working, the incremental backup should complete in a fraction of the time compared to the initial copy.
- Install the remote NAS at it’s off-site location and configure the local firewall with the correct ports as per Synology documentation and confirm the hostname and IP are correct with the DDNS service.
- On the local NAS turn on trsansfer encryption in the Time Backup Task and configure the local firewall as per the Synology documentation.
- You must undo the changes made to the hosts file on the local device.
- Using PuTTy log into the local NAS as per step 3 above.
- Type cd /etc <press enter>
- If you made a copy of the hosts file as per step 3, just copy it back over the existing hosts file with cp hosts.bak hosts <press enter> or edit the hosts file to remove the entry of the remote hostname and the local IP.
- Test that local NAS has updated the hostname to the public Internet IP by pinging the hostname: Example: Type ping remote.snaz.synology.me <press enter> Stop the pings with <CTRL> + C. The remote device does not have to respond to the pings but you should see the new public Internet IP.
- Turn off SSH/Telnet in Control Panel.