How to create a timemachine like replication?

I’m using freenas/trueNAS Core a long time, but i did not have understood the deeper details of the game of periodic snapshot an replication tasks.

My system have a ssd and a hdd for backup. The pool on the ssd is called data, the pool on hdd called backup. I wish to have a hourly copy of all files on data on the backup pool and keep this files for two days. 2nd i will keep a dayly copy for four weeks.

Using the gui there are two ways to configure replication. A simple dialog, who create an auto… snapshot task, and an andvanced dialog where i can choose exsisting periodic snapshot tasks to use. Thre are many ways to go.

Create two replications with the simple dialog (followed by automatic created periodic snapshot tasks)? Or create two periodic snapshot tasks first and configure the replication in advanced dialog to meet the specific snapshop task? In this case two replications or only one and bind on both snapshot tasks?

Or create one periodic snapshot task and two replications with differed time schedule and differend keeping time?

Setup tiered snapshots, then replicate those snapshots with a single replication task.

2 Likes

Thank You, Stux. This was one of the less combinations i never try before. I allway want to get the advantage to keep the snapshots longer on the big and cheap backup pool and save space on the expensiv and fast data pool.

But the soloution is OK. All the last years i keep every snapshot on data and backup. I had to erase manualy…

By the way, Stux, many people would be happy if you would make a video about replication…

2 Likes

Sorry, no luck. After reorganisation the snapshot tasks the replication fails with

 Error

No incremental base on dataset 'SSD-Pool/data' and replication from scratch is not allowed.

First it works, maybe becourse ther are an “auto…” snapshot task? Or some other mystic reasons. I don’t kwon the hidden secrets behind snapshots and replication…

There is a checkbox “Replication from scratch”. This will prevent these error messages.

Some say ist’s completly wrong to use it. The dialog say you will get lost of data and excessive data transfer if activated. Other say it shoud be deactivated after first run. I remember, deactivating will bring back the error, but i don’t know.

I don’t know it’ exacly what I have understood about replication…but i woud like to learn it…

You need to tick

Save Pending Snapshots

Also the deletion policy should be set to Source

Both was already set as you say. This options are clear for me. They havn’t an impact on the error messages.

But i don’t whats going on behind if Replication from scratch is checked on? And why and when is it necessarry?

I found some information that says a virgin dataset as a target does not need replication from scratch. It’s needed if the connection between sended data and data already stored in the destination is lost.

How is this connection build? Can i find a documentation about the details?

OK, i have learned a little. You don’t need replication from scratch if you an untouched destination dataset. And now i was able to switch replication from scrach on, run one replicatione (or more) and turn it off again without bringing the error back (as I had often experienced in the past).

Now every replication task run as desiered. Thank you, Stux.

I will report here if i find more in-depth information about datasets, snapshots and replication.