#!/usr/bin/env bash # # How to migrate data from a UGREEN NAS to TrueNAS SCALE with rsync # https://www.zadran.net/guides/migrate-ugreen-nas-to-truenas-rsync # Generated from the guide, last updated 2026-09-13. # # NO WARRANTY. This script is provided as is. You are responsible for # understanding what it does before running it, and for the consequences. # Take a backup first. See https://www.zadran.net/disclaimer # # Destructive steps are left commented out on purpose -- uncomment them # only once you have understood what they do. set -euo pipefail # ---- Set these for your environment ---- # Something you will recognise in three days SESSION_NAME='nas-migration' # The account you SSH to the source as SOURCE_USER='admin' # Hostname or IP of the machine holding the data SOURCE_HOST='nas-old.example.lan' # Directory to copy from, without a trailing slash SOURCE_PATH='/volume1/Shared' # Where it lands, without a trailing slash DEST_PATH='/mnt/tank/Shared' tmux new -s ${SESSION_NAME} tmux attach -t ${SESSION_NAME} rsync -aHAX --partial --info=progress2 \ ${SOURCE_USER}@${SOURCE_HOST}:${SOURCE_PATH}/ \ ${DEST_PATH}/ tmux attach -t ${SESSION_NAME} rsync -aHAX --partial --info=progress2 \ ${SOURCE_USER}@${SOURCE_HOST}:${SOURCE_PATH}/ \ ${DEST_PATH}/ rsync -aHAXn --itemize-changes \ ${SOURCE_USER}@${SOURCE_HOST}:${SOURCE_PATH}/ \ ${DEST_PATH}/ | head -50 # !! DESTRUCTIVE -- review, then uncomment to run: # rsync -aHAX --delete --info=progress2 \ # ${SOURCE_USER}@${SOURCE_HOST}:${SOURCE_PATH}/ \ # ${DEST_PATH}/ tmux kill-session -t ${SESSION_NAME}