TSF – Giải pháp IT toàn diện cho doanh nghiệp SMB | HCM

P11 - Backup Restore Datasets on TrueNAS

🚀 TrueNAS P11 – How to Backup Restore Datasets on TrueNAS SCALE (Step-by-Step Guide)

Data protection is one of the most critical responsibilities of any system administrator. In this guide, I will show you exactly how to Backup Restore Datasets on TrueNAS SCALE using a practical, step-by-step approach.

You will learn how to:

  • Prepare backup storage destinations

  • Select datasets properly

  • Run manual backup commands

  • Automate backups using Cron jobs

  • Create date-based backup folders

  • Restore data safely without affecting configuration

This tutorial is suitable for:

  • Home lab users

  • IT helpdesk engineers

  • Small business NAS administrators

  • Enterprise storage environments

By the end of this guide, you will confidently manage reliable dataset backups and restore operations on TrueNAS SCALE.


🧠 Why Backup Restore Datasets Is Critical

Without a proper backup strategy, your NAS environment is exposed to:

❌ Accidental deletion
❌ Ransomware attacks
❌ Hardware failure
❌ Misconfiguration

Implementing a structured Backup Restore Datasets workflow ensures:

✅ Data integrity
✅ Business continuity
✅ Fast recovery
✅ Minimal downtime

TrueNAS SCALE combined with rsync provides a powerful and flexible backup solution.


🛠 Step 1 – Create a Backup Folder

Before running backups, you must prepare a backup destination.

You should mount external storage such as:

  • SMB

  • NFS

  • OneDrive

  • Other remote storage

In this demo, we will use an SMB folder.

Example mount path:

 
 
/mnt/smbbackup
 

Datasets to back up:

 
 
Department
Homefolder
 

Ensure that the SMB folder is properly mounted and accessible before continuing.

You can verify by running:

 
 
ls /mnt/smbbackup
 

If the directory is accessible, you are ready to proceed.


🔄 Step 2 – Run the Backup Command

We will use rsync to copy datasets from TrueNAS to the backup destination.

Run the following command:

 
 
sudo rsync -avh /mnt/volume1 /mnt/smbbackup/
 

Explanation:

  • -a → Archive mode (preserves permissions, ownership, timestamps)

  • -v → Verbose output

  • -h → Human-readable file sizes

This command copies all data from:

 
 
/mnt/volume1
 

To:

 
 
/mnt/smbbackup/
 

Wait for the process to complete. The duration depends on dataset size and network speed.

Once completed, your datasets are backed up to the external SMB storage.


⏰ Step 3 – Create a Cron Job for Automated Backup

Manual backups are useful for testing, but production environments require automation.

Navigate to:

 
 
System → Cron Jobs
 

Create a new Cron job with the following command:

 
 
rsync -av /mnt/volume1/ /mnt/smbbackup/
 

Important difference:

Notice the trailing slash in /mnt/volume1/.

This ensures proper synchronization behavior.

Configure the schedule according to your backup policy (daily, weekly, etc.).

After saving, perform a test run to verify everything works correctly.


📅 Step 4 – Cron Job with Date-Based Backup Folder

To improve organization and allow multiple restore points, you can create backups by date.

Edit the Cron job command as follows:

 
 
rsync -av /mnt/volume1/ /mnt/smbbackup/backup_$(date +\%Y-\%m-\%d)/
 

What this does:

  • Automatically creates a new folder named with the current date

  • Example:

 
 
backup_2026-02-19
 

This approach provides:

✅ Multiple restore versions
✅ Clear backup history
✅ Easier recovery management

Each day a new dated folder will be created automatically.


🔁 How to Restore Datasets Safely

When performing a restore operation, follow these principles:

  1. Verify backup folder integrity

  2. Avoid overwriting active datasets without confirmation

  3. Test restore on a temporary path if possible

To restore data manually:

 
 
sudo rsync -avh /mnt/smbbackup/backup_YYYY-MM-DD/ /mnt/volume1/
 

Replace YYYY-MM-DD with the appropriate backup date.

Always verify file integrity after restore.


⚡ Common Errors and Quick Fixes

When implementing Backup Restore Datasets, you may encounter:

❌ Permission denied
→ Check dataset ownership and SMB mount permissions.

❌ Network timeout
→ Verify connectivity and firewall rules.

❌ Incomplete sync
→ Ensure enough storage space on destination.

❌ Cron job not running
→ Double-check schedule configuration and system time.

Troubleshooting early prevents data loss risks.


📈 Best Practices for Production Backup Strategy

To optimize your TrueNAS backup workflow:

  • Use separate storage devices for backup

  • Monitor available disk space

  • Test restore procedures regularly

  • Implement off-site backups if possible

  • Combine rsync with snapshot strategy

A backup is only reliable if restore works successfully.


🎯 Final Result

After completing this guide, you can:

✅ Backup Restore Datasets confidently
✅ Automate backups using Cron
✅ Organize backups by date
✅ Restore data without damaging configuration
✅ Improve NAS reliability

This setup provides a stable and scalable backup foundation for TrueNAS SCALE environments.


📌 Conclusion

Understanding how to Backup Restore Datasets on TrueNAS SCALE is fundamental for any serious NAS deployment.

With rsync and Cron jobs, you can implement a flexible, automated, and secure backup system in just a few steps.

Whether you are managing a home lab or an enterprise NAS, mastering dataset backup and restore ensures long-term data protection and operational stability.

Never wait for data loss to happen — build your backup strategy today.

See also related articles

P21 – Effortless WordPress TrueNAS Setup Guide

P21 – Effortless WordPress TrueNAS Setup Guide 🚀 TrueNAS P21 – WordPress TrueNAS Apps Demo Deploy WordPress Easily (No Docker Skills Needed) Deploying WordPress on a NAS no longer requires deep Docker knowledge or complex manual configurations. With WordPress TrueNAS Apps, you can launch a fully functional WordPress instance directly...

Read More

P20 – Essential ZFS Disk Scrubbing Best Practices Guide

P20 – Essential ZFS Disk Scrubbing Best Practices Guide 🚀 TrueNAS – P20: ZFS Disk Scrubbing – Step-by-Step Configuration & Best Practices Maintaining data integrity is one of the most important responsibilities of any storage administrator. Even enterprise-grade disks can develop silent data corruption over time. This is where ZFS...

Read More

P18 – Ultimate MFA TrueNAS Security Setup Guide

P18 – Ultimate MFA TrueNAS Security Setup Guide 🚀 TrueNAS – P18: Secure TrueNAS with MFA (Google Authenticator) – Full Configuration Tutorial Security is critical for any production storage system. A strong password alone is no longer enough. If credentials are leaked, brute-forced, or reused elsewhere, your entire NAS infrastructure...

Read More