Tutorials 10 min read

Migrating from a Synology to a DIY NAS in 2026: Step-by-Step Guide

Migrate from a Synology to a DIY NAS on Ubuntu Server 24.04: mirrored ZFS pool, verified rsync copy over SSH, Samba share limited to the local network, and a firewall.

See our picks
S By Selfhostr Team · no sponsored content
Migrating from a Synology to a DIY NAS in 2026: Step-by-Step Guide
ⓘ ⓘ This article may contain affiliate links (no extra cost to you, it funds the site). As an Amazon Associate, Selfhostr earns from qualifying purchases. See the disclosure.
⏱️
~45 min
Duration
🎚️
Intermediate
Difficulty
💶
0 € (free software)
Cost
📦
Ubuntu 24.04 installed on your chosen hardware.
Key Prerequisites

👍 What we like

  • ✓Non-destructive method: the Synology stays intact until the copy is fully verified.
  • ✓Free, documented tools (ZFS, rsync, Samba, ufw), with no vendor lock-in.
  • ✓ZFS provides redundancy, checksums and snapshots.
  • ✓Incremental copy: the final pass only transfers changed files.

👎 What to watch

  • ✕You need new drives large enough to hold a full copy.
  • ✕Users, passwords and DSM apps (Photos, Drive…) have to be recreated by hand.
  • ✕Command-line administration and maintenance (updates, scrubs, backups) are up to you.
  • ✕The initial copy of a large volume can take a long time over Gigabit networking.

🏆 Our picks

Affiliate links · same price for you
Recommends
Synology DS1522+

Synology DS1522+

Voir sur Amazon

Amazon · price and availability on the listing

Alternative
UGREEN NASync DXP4800 Plus

UGREEN NASync DXP4800 Plus

Voir sur Amazon

Amazon · price and availability on the listing

See all our recommended gear in the shop.

📑 Contents ▾

Leaving a Synology for a self-built NAS isn’t a matter of moving the disks or launching some miracle container. The reliable method is to install the new server next to the old one, create redundant storage, then copy the data over the network with rsync. Throughout the process, the Synology stays untouched: it is your safety net. This guide uses Ubuntu Server 24.04 LTS, a ZFS mirror and Samba, all free and well-documented tools. If you’d rather use a ready-made NAS distribution with a web interface, the same copy logic applies to TrueNAS SCALE (see the links at the end).

Prerequisites

  • A Synology running DSM 7 and an account in the administrators group (only those accounts can log in to DSM over SSH).
  • A machine for the DIY NAS, with a separate system SSD and at least two data drives large enough to hold everything on the Synology.
  • Ubuntu Server 24.04 LTS installed on the system SSD (never put the system on an external USB drive).
  • Both machines on the same local network, with a fixed or DHCP-reserved IP address (in the examples: Synology at 192.168.1.20, DIY NAS at 192.168.1.30, network 192.168.1.0/24).
  • A recent, verified backup of your important data, stored somewhere other than the two NAS units.

Step-by-step installation

Step 1: Take inventory and prepare the Synology

In DSM, write down:

  • your shared folders (Control Panel > Shared Folder) and their size;
  • users and groups (Control Panel > User & Group);
  • the apps you’ll need to replace (Container Manager, Synology Photos, Drive…), since they don’t migrate automatically;
  • any encrypted shared folders: they must be mounted (unlocked) before you can copy them.

Then enable the services needed for the copy:

  1. Control Panel > Terminal & SNMP > Terminal: tick Enable SSH service, then Apply.
  2. Control Panel > File Services > rsync: tick Enable rsync service, then Apply.
  3. Check that your account has the rsync privilege: Control Panel > Application Privileges > rsync.

From a computer on the local network, check access:

ssh admin@192.168.1.20 'df -h /volume1; ls /volume1; rsync --version | head -n1'

You should see the volume’s used space, the list of shared folders and an rsync version. Write down the used space: your future pool has to be larger.

Step 2: Prepare the Ubuntu server

Update the system and install ZFS, Samba and the tools you’ll need:

sudo apt update && sudo apt full-upgrade -y
sudo apt install -y zfsutils-linux samba smbclient rsync tmux ufw

Check:

zfs version
smbd --version
rsync --version | head -n1

Each command should print a version number. If zfs version fails, reboot after the kernel update and try again.

Step 3: Create the mirrored ZFS pool

⚠️ Warning: this step completely erases the drives you specify. First make sure you aren’t targeting the system SSD.

Identify the drives:

lsblk -o NAME,SIZE,MODEL,SERIAL,MOUNTPOINTS
ls -l /dev/disk/by-id/ | grep -v part

Find the two data drives by their size and serial number. The drive that holds / (the system SSD) must not appear in the command. Use the /dev/disk/by-id/… paths: they stay the same between boots, unlike /dev/sdX.

sudo zpool create -o ashift=12 -O compression=lz4 -O atime=off -m /tank tank \
  mirror /dev/disk/by-id/ata-DISK1_SERIAL1 /dev/disk/by-id/ata-DISK2_SERIAL2

sudo zfs create tank/partage

Replace the two IDs with your own. Create one dataset per Synology shared folder (tank/photos, tank/documents…).

Check:

sudo zpool status tank
zfs list

zpool status should show state: ONLINE and a mirror-0 containing both drives. zfs list should show tank/partage mounted at /tank/partage.

Step 4: Create users and permissions

Recreate the Synology accounts. Passwords don’t carry over, so you need to set new ones.

sudo groupadd nas
sudo adduser marie
sudo usermod -aG nas marie
sudo chown -R root:nas /tank/partage
sudo chmod -R 2770 /tank/partage

Check:

id marie
ls -ld /tank/partage

id should list the nas group. ls -ld should show drwxrws--- with root nas.

Step 5: Transfer the data with rsync

The DIY NAS pulls the data over SSH. Run the copy inside tmux: if your SSH session drops, the copy keeps going.

tmux new -s migration

Always start with a dry run (-n), which lists the files without copying anything:

sudo rsync -rltH -n --info=progress2 --partial \
  --exclude='@eaDir' --exclude='#recycle' --exclude='#snapshot' \
  admin@192.168.1.20:/volume1/partage/ /tank/partage/

If the list looks right, run the command again without -n:

sudo rsync -rltH --info=progress2 --partial \
  --exclude='@eaDir' --exclude='#recycle' --exclude='#snapshot' \
  admin@192.168.1.20:/volume1/partage/ /tank/partage/

Some notes:

  • The trailing slash on /volume1/partage/ copies the folder’s contents.
  • -rltH copies the directory tree, symlinks, timestamps and hard links. DSM owners and ACLs are not kept, because Synology UIDs don’t match Ubuntu’s.
  • @eaDir, #recycle and #snapshot are DSM-internal folders (thumbnails, recycle bin, snapshots).

To detach from tmux without stopping the copy, press Ctrl+B then D. tmux attach -t migration takes you back. Repeat the command for each shared folder.

Final pass: the day before the switchover, make the Synology shared folders read-only (Control Panel > Shared Folder > Edit > Permissions). Then run the same rsync command again: only files changed since the first copy get transferred. Finally, reapply the permissions:

sudo chown -R root:nas /tank/partage
sudo find /tank/partage -type d -exec chmod 2770 {} +
sudo find /tank/partage -type f -exec chmod 660 {} +

Check (compare the file count on both sides):

ssh admin@192.168.1.20 "find /volume1/partage -type f -not -path '*@eaDir*' -not -path '*#recycle*' -not -path '*#snapshot*' | wc -l"
sudo find /tank/partage -type f | wc -l

The two numbers must match. For a full content check, which takes longer because it rereads everything, run:

sudo rsync -rltHn --checksum --itemize-changes \
  --exclude='@eaDir' --exclude='#recycle' --exclude='#snapshot' \
  admin@192.168.1.20:/volume1/partage/ /tank/partage/

If this command prints no file lines, the two copies are identical.

Step 6: Share the data with Samba (local network only)

Add this to the end of /etc/samba/smb.conf:

[partage]
   path = /tank/partage
   browseable = yes
   read only = no
   valid users = @nas
   force group = nas
   create mask = 0660
   directory mask = 2770

In the [global] section of the same file, restrict access to the local network:

   hosts allow = 127. 192.168.1.
   hosts deny = 0.0.0.0/0

Set a Samba password for each user, then check the configuration and restart the service:

sudo smbpasswd -a marie
testparm -s
sudo systemctl restart smbd

Check:

smbclient //localhost/partage -U marie -c 'ls'

The folder contents should be listed. On a Windows PC, open \\192.168.1.30\partage. On macOS: Finder > Go > Connect to Server, then smb://192.168.1.30/partage.

Step 7: Firewall restricted to the local network

sudo ufw default deny incoming
sudo ufw allow from 192.168.1.0/24 to any port 22 proto tcp
sudo ufw allow from 192.168.1.0/24 to any port 445 proto tcp
sudo ufw enable

Check:

sudo ufw status verbose

Only the 22/tcp and 445/tcp rules limited to 192.168.1.0/24 should appear. Do not create any port forwarding to this server on your router.

Step 8 (optional): Recreate your Container Manager containers

If you used Container Manager, install Docker from the official repository:

sudo apt install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Check:

sudo docker run --rm hello-world
docker compose version

Next, stop the containers on the Synology and copy their data folders (often /volume1/docker) with the Step 5 rsync command. Recreate each service from its project’s official compose.yaml, adjusting the volume paths.

Verification checks

  • sudo zpool status -x should return all pools are healthy.
  • The file count and the Step 5 --checksum check should show no differences.
  • From a client computer, open and edit a few recent and older files (photos, office documents).
  • Take a baseline snapshot with sudo zfs snapshot tank/partage@post-migration, then check it with zfs list -t snapshot.

Keep the Synology powered on and untouched for at least a few weeks before reusing its drives.

Security and best practices

  • Nothing is exposed to the Internet: not SSH, not Samba, not any admin interface. For remote access, use a VPN (WireGuard, Tailscale…).
  • Once the migration is done, turn off SSH and rsync on the Synology (same menus as Step 1).
  • A ZFS mirror is not a backup. Keep a copy off the server. The old Synology can serve as a backup target.
  • Ubuntu’s zfsutils-linux package normally schedules a periodic scrub. Check that it’s there with cat /etc/cron.d/zfsutils-linux. For automatic snapshots, a tool such as sanoid is available in the repositories (check the documentation for your version).
  • Install updates regularly (sudo apt update && sudo apt upgrade). The unattended-upgrades package installs security fixes automatically.

Troubleshooting common errors

  • Symptom: Permission denied or rsync: connection unexpectedly closed when starting rsync. Cause: the DSM account isn’t in the administrators group, lacks the rsync privilege, or the rsync service is disabled. Fix: go back over Step 1 (Terminal & SNMP, File Services > rsync, Application Privileges).

  • Symptom: a shared folder appears empty or can’t be found. Cause: an encrypted folder isn’t mounted, or the path is wrong (for example /volume2 instead of /volume1). Fix: mount the folder in DSM, then check the path with ssh admin@192.168.1.20 'ls /volume*'.

  • Symptom: zpool create refuses, saying the drive contains a filesystem or belongs to a pool. Cause: the drive has been used before. Fix: check with lsblk that it really is the right drive. Only then add -f to the command. All data on that drive will be lost.

  • Symptom: NT_STATUS_LOGON_FAILURE when connecting to Samba. Cause: the user has no Samba password. Fix: sudo smbpasswd -a username. The Linux password isn’t enough.

  • Symptom: the share can’t be reached from a PC. Cause: the firewall, hosts allow or a different subnet. Fix: sudo ufw status, testparm -s, then check the client’s IP address.

FAQ

What hardware should I choose for my DIY NAS in 2026?

The Synology DS1522+ is not a DIY NAS: it runs DSM. In this guide it’s typically the machine you’re leaving, and afterwards it can serve as a backup target. The UGREEN NASync DXP4800 Plus ships with the UGOS system. Community guides and forums report that you can install another OS on it (Ubuntu, TrueNAS), but this guide does not present that as an official procedure: check the warranty terms and UGREEN’s documentation. Otherwise, a PC or an ITX motherboard with enough SATA ports (or an HBA card) works very well.

Can I just move the Synology drives into the new NAS?

That isn’t recommended. DSM’s SHR/Btrfs volumes sit on an mdadm + LVM + Btrfs stack that Synology only presents as a data-recovery option under Linux. Copying over the network leaves the original intact and lets you build a clean ZFS pool from the start.

Are there risks involved with migrating to a DIY NAS?

The main risks are wiping the wrong drive or deleting the original too early. Check with lsblk before creating any pool, keep an external backup, and only reuse the Synology drives once you’ve verified the copy.

Do I need to keep paying for Synology if I migrate?

You buy a Synology once: there’s no mandatory subscription to cancel. Only optional services, such as Synology C2 (cloud storage, backup), cost money. If you use them, set up an alternative before cancelling.

Read also

Tags: synologynas-diymigration-2026self-hostinghomelab

Related

Tutorials

Configure Dockge to manage your Docker containers in 2026

Learn how to install and configure Dockge, a lightweight and self-hosted Docker Compose stack manager, perfect for homelabs and self-hosting.

Read
Tutorials

Install OPNsense on a Mini-PC in 7 Steps for 2026

Install OPNsense on an x86-64 mini-PC in 7 steps: verified vga USB image, ZFS install, WAN/LAN interfaces, wizard, Dnsmasq DHCP, Unbound DNS filtering and backup, using the menus from the official documentation.

Read
Tutorials

Getting Started with Docker Compose in Your Home Lab for 2026

First Docker Compose stack for your homelab: Docker from the official repository, the Compose v2 plugin, Nginx, MariaDB and LAN-only phpMyAdmin, with valid files and a check at every step.

Read