UniFi UNAS-Pro Pool Migration Strategy: Pool 1 (SSD) to Pool 2 (HDD)#

This document defines the operational plan, safety protocols, database update queries, and verification steps to migrate all shared folders from Storage Pool 1 (SSD - Degraded RAID5) to Storage Pool 2 (HDD - Healthy RAID5) on the master UniFi UNAS-Pro NAS (10.1.2.2) while preserving all access rights, Samba configurations, and TrueNAS backup operations.

Antigravity chat: agy –conversation=3dd15667-3c79-485d-af10-ebb5c4f9cc01


1. Executive Summary & Objective#

Due to hardware failures on Pool 1 (Slot 2 pulled, Slot 3 accumulating 75,000+ write failures), Pool 1 is operating with zero fault tolerance. To prevent data loss prior to receiving warranty replacement drives, all active shares on Pool 1 will be migrated to Pool 2.

Storage Pool UUID Reference:#

  • Source Pool 1 (SSD - Failing): dc22b333-6282-4193-b949-aad01df0bd3d
  • Target Pool 2 (HDD - Healthy): 6e27154a-8dc4-47dc-ad96-befb70ec47e9

2. Pre-Migration Checklist#

Complete these preparatory steps before initiating data transfers to minimize risk and avoid false backup alerts.

  • 2.1 Verify Target Storage Space on Pool 2:

    • Pool 2 currently has ~12 TB of available space, which is more than sufficient for the ~2.3 TB of data residing on Pool 1.
  • 2.2 Download UniFi OS Web GUI Console Backup:

    • Open https://10.1.2.2 -> Console Settings / System Settings -> Click Download Configuration Backup to save the .unifi configuration file to your local computer.
  • 2.3 Create Low-Level Database & System Config Backup (SSH):

    # Back up the UniFi Drive PostgreSQL database
    ssh root@10.1.2.2 "pg_dump -U postgres unifi-drive > /persistent/unifi_drive_backup_\$(date +%Y%m%d).sql"
    
    # Back up Samba and OS configuration files
    ssh root@10.1.2.2 "tar -czvf /persistent/unas_etc_backup_\$(date +%Y%m%d).tar.gz /etc/samba /etc/smb.conf"
  • 2.4 Deactivate TrueNAS Fleet Backup Cron Jobs:

    • Run the following commands to disable cron jobs across all 5 TrueNAS nodes:
    • 2.4.1 HP1 (10.1.2.201) - Cron ID 6: ssh marcoue@10.1.2.201 "sudo midclt call cronjob.update 6 '{\"enabled\": false}'"
    • 2.4.2 HP2 (10.1.2.212) - Cron ID 1: ssh marcoue@10.1.2.212 "sudo midclt call cronjob.update 1 '{\"enabled\": false}'"
    • 2.4.3 HP3 (10.1.2.213) - Cron ID 2: ssh marcoue@10.1.2.213 "sudo midclt call cronjob.update 2 '{\"enabled\": false}'"
    • 2.4.4 HP7 (10.1.1.17) - Cron ID 5: ssh marcoue@10.1.1.17 "sudo midclt call cronjob.update 5 '{\"enabled\": false}'"
    • 2.4.5 HP8 (10.1.2.208) - Cron ID 1: ssh marcoue@10.1.2.208 "sudo midclt call cronjob.update 1 '{\"enabled\": false}'"

3. Step-by-Step Execution Plan#

  • 3.1 Stop Dependent Services: Stop file sharing and synchronization daemons to ensure a static state during transfer:

    ssh root@10.1.2.2 "systemctl stop unifi-drive smbd"
  • 3.2 Priority Data Transfer (rsync): Copy each share directory from Pool 1 to Pool 2 using rsync with full metadata preservation flags (-aHAXS preserves ACLs, owner/group, timestamps, symlinks, and extended attributes).

    • 3.2.1 Documents (25.35 GB):

      rsync -aHAXS --progress /volume/dc22b333-6282-4193-b949-aad01df0bd3d/.srv/.unifi-drive/Documents/ /volume/6e27154a-8dc4-47dc-ad96-befb70ec47e9/.srv/.unifi-drive/Documents/
    • 3.2.2 Photos (1.8 TB):

      rsync -aHAXS --progress /volume/dc22b333-6282-4193-b949-aad01df0bd3d/.srv/.unifi-drive/Photos/ /volume/6e27154a-8dc4-47dc-ad96-befb70ec47e9/.srv/.unifi-drive/Photos/
    • 3.2.3 Books (55.13 GB):

      rsync -aHAXS --progress /volume/dc22b333-6282-4193-b949-aad01df0bd3d/.srv/.unifi-drive/Books/ /volume/6e27154a-8dc4-47dc-ad96-befb70ec47e9/.srv/.unifi-drive/Books/
    • 3.2.4 Software (346.8 GB):

      rsync -aHAXS --progress /volume/dc22b333-6282-4193-b949-aad01df0bd3d/.srv/.unifi-drive/Software/ /volume/6e27154a-8dc4-47dc-ad96-befb70ec47e9/.srv/.unifi-drive/Software/
    • 3.2.5 HomesDSM (16 GB):

      rsync -aHAXS --progress /volume/dc22b333-6282-4193-b949-aad01df0bd3d/.srv/.unifi-drive/HomesDSM/ /volume/6e27154a-8dc4-47dc-ad96-befb70ec47e9/.srv/.unifi-drive/HomesDSM/
    • 3.2.6 Nadine (17 GB):

      rsync -aHAXS --progress /volume/dc22b333-6282-4193-b949-aad01df0bd3d/.srv/.unifi-drive/Nadine/ /volume/6e27154a-8dc4-47dc-ad96-befb70ec47e9/.srv/.unifi-drive/Nadine/
    • 3.2.7 GoogleCloudSync (4.1 GB):

      rsync -aHAXS --progress /volume/dc22b333-6282-4193-b949-aad01df0bd3d/.srv/.unifi-drive/GoogleCloudSync/ /volume/6e27154a-8dc4-47dc-ad96-befb70ec47e9/.srv/.unifi-drive/GoogleCloudSync/
    • 3.2.8 Immich (32 GB):

      rsync -aHAXS --progress /volume/dc22b333-6282-4193-b949-aad01df0bd3d/.srv/.unifi-drive/Immich/ /volume/6e27154a-8dc4-47dc-ad96-befb70ec47e9/.srv/.unifi-drive/Immich/
    • 3.2.9 Musique (96 GB):

      rsync -aHAXS --progress /volume/dc22b333-6282-4193-b949-aad01df0bd3d/.srv/.unifi-drive/Musique/ /volume/6e27154a-8dc4-47dc-ad96-befb70ec47e9/.srv/.unifi-drive/Musique/
  • 3.3 Relocate Database References: Update the unifi-drive PostgreSQL database to map all migrated shares to Storage Pool 2:

    ssh root@10.1.2.2 "psql -U postgres -d unifi-drive -c \"
    UPDATE shared_drives 
    SET storage_pool_id = '6e27154a-8dc4-47dc-ad96-befb70ec47e9' 
    WHERE storage_pool_id = 'dc22b333-6282-4193-b949-aad01df0bd3d';
    \""
  • 3.4 Restart Services & Rebuild Configs: Restart the services. UniFi OS will read the database update and automatically regenerate /etc/samba/share.conf with the new Pool 2 paths:

    ssh root@10.1.2.2 "systemctl start unifi-drive smbd"

4. Verification & Post-Migration Checks#

  • 4.1 Verify Samba Config Paths:

    ssh root@10.1.2.2 "cat /etc/samba/share.conf | grep path"

    Confirm all share paths now point to /volume/6e27154a-8dc4-47dc-ad96-befb70ec47e9/...

  • 4.2 Verify Rsync Module Resolution:

    ssh root@10.1.2.2 "rsync root@10.1.2.2::"

    Confirm all 12 modules resolve cleanly.

  • 4.3 Verify Web UI Access:

    • Open https://10.1.2.2 -> UniFi Drive. Verify that all shared drives show Storage Pool 2.
  • 4.4 Update Mac Workstation Git Hook:

    • Update /Users/marc/Scripts/.git/hooks/post-commit to point to root@10.1.2.2::Software/Software/Scripts/TrueNAS/.
  • 4.5 Reactivate All TrueNAS Fleet Backup Cron Jobs:

    • Re-enable all background backup cron jobs across the 5 TrueNAS nodes:
    • 4.5.1 HP1 (10.1.2.201): ssh marcoue@10.1.2.201 "sudo midclt call cronjob.update 6 '{\"enabled\": true}'"
    • 4.5.2 HP2 (10.1.2.212): ssh marcoue@10.1.2.212 "sudo midclt call cronjob.update 1 '{\"enabled\": true}'"
    • 4.5.3 HP3 (10.1.2.213): ssh marcoue@10.1.2.213 "sudo midclt call cronjob.update 2 '{\"enabled\": true}'"
    • 4.5.4 HP7 (10.1.1.17): ssh marcoue@10.1.1.17 "sudo midclt call cronjob.update 5 '{\"enabled\": true}'"
    • 4.5.5 HP8 (10.1.2.208): ssh marcoue@10.1.2.208 "sudo midclt call cronjob.update 1 '{\"enabled\": true}'"
  • 4.6 Post-Migration Cleanup of Temporary Backup Files:

    • Clean up temporary pre-migration PostgreSQL database dump and configuration tarball from persistent flash memory once migration and verification are 100% complete:
    ssh root@10.1.2.2 "rm -f /persistent/unifi_drive_backup_*.sql /persistent/unas_etc_backup_*.tar.gz"

5. Rollback Procedure (Disaster Recovery)#

If a service issue occurs during migration:

  • 5.1 Restore Database from Pre-Migration Dump:
    ssh root@10.1.2.2 "psql -U postgres -d unifi-drive < /persistent/unifi_drive_backup_YYYYMMDD.sql"
  • 5.2 Restart Services:
    ssh root@10.1.2.2 "rc-service unifi-drive restart && rc-service samba restart"