SOLVED Need help replicating data from one Freenas server to another

Status
Not open for further replies.

BloodyBonkers

Dabbler
Joined
Sep 17, 2017
Messages
21
Hello, I am unsure how I should formulate the zfs send zfs receive command to replicate all data from my main FreeNAS box(Freenas1) to a new temporary FreeNAS box(Freenas2).

Here's the information I believe is relevant:
Freenas1 has the pool name Volume1 with a primary dataset named Volume1 and has the IP 192.168.2.201 (FreeNAS-11.2-MASTER-201807080450)
Freenas2 has the pool name Volume2 with a primary dataset named Volume2 and has the IP 192.168.2.185 (FreeNAS-11.2-BETA1)
Snapshot of dataset Volume1 on Freenas1 has been made with fullname: Volume1@volume1

After changing the pool configuration on Freenas1 and going back to (FreeNAS-11.2-BETA1) I will also need to move all the data back again.

This is what I came up with and I would like a confirmation or a correction before I try using it.

From Freenas1 to Freenas2:
zfs send Volume1/Volume1@volume1 | ssh 192.168.2.185 zfs recv Volume2/Volume1

back from Freenas2 to Freenas1
zfs send Volume2/Volume1@"snapshot name" | ssh 192.168.2.201 zfs recv Volume1/Volume1
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
zfs send Volume1/Volume1@volume1 | ssh 192.168.2.185 zfs recv Volume2/Volume1
Why from Volume1 to Volume2?
zfs send Volume2/Volume1@"snapshot name" | ssh 192.168.2.201 zfs recv Volume1/Volume1
AHHH WHY FROM 2 to 1?!!?o_O
Are you screwing with us or just you just have a screwy naming convention?:eek:
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Why from Volume1 to Volume2?
Because the pool in server 1 is called Volume1, and the pool in server 2 is called Volume2.

OP, you could just use the replication tasks made available in the GUI, then you wouldn't need to deal with the CLI.
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
Because the pool in server 1 is called Volume1, and the pool in server 2 is called Volume2.

OP, you could just use the replication tasks made available in the GUI, then you wouldn't need to deal with the CLI.
I guess he likes to live dangerously! That would just be way to easy for me to mess up. Calling both pools and datasets volumes....:confused:
 

BloodyBonkers

Dabbler
Joined
Sep 17, 2017
Messages
21
AHHH WHY FROM 2 to 1?!!?o_O
Are you screwing with us or just you just have a screwy naming convention?:eek:

Volume2 is just a temporary raidz1 on consumer grade hardware that I wish to store my data on while wiping Volume1(now raidz1) to add a disk and create a raidz2 to create Volume1. After this is done I intend to move all the data back to the new volume1.

OP, you could just use the replication tasks made available in the GUI, then you wouldn't need to deal with the CLI.
I intended to do this at first but was unable to select anything in the Pool/dataset section in the UI. Hence the use of CLI

I forgot to make the snapshot of Volume1 recursive so I had to redo that.
The command I ended up using was: zfs send -R Volume1@volume1 | ssh 192.168.2.185 zfs recv Volume2/Volume1
This worked and the files are copying as we speak.

When moving back I will just do the same, just the other way around.
 

BloodyBonkers

Dabbler
Joined
Sep 17, 2017
Messages
21
I guess he likes to live dangerously! That would just be way to easy for me to mess up. Calling both pools and datasets volumes....:confused:
This has worked for me so far, but I should probably start calling the pool something else to avoid confusion.
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
This has worked for me so far, but I should probably start calling the pool something else to avoid confusion.
Yeah I renamed mine to reflect the host name and role if needed. So on one the pool is FN01 and the backup is FN02 so for example send command may be something like:
zfs send -R FN01@vmblock-20180614 | ssh FN02 zfs recv FN02/vmblock-20180614
Again notethe hostname matches the pool name. this being my home lab I only have one pool per host but if I had more it might be FN01-VM-T1 for tier 1 vmware storage. Naming conventions are something that needs to be taught in school.
 

BloodyBonkers

Dabbler
Joined
Sep 17, 2017
Messages
21
Yeah I renamed mine to reflect the host name and role if needed. So on one the pool is FN01 and the backup is FN02 so for example send command may be something like:
zfs send -R FN01@vmblock-20180614 | ssh FN02 zfs recv FN02/vmblock-20180614
Again notethe hostname matches the pool name. this being my home lab I only have one pool per host but if I had more it might be FN01-VM-T1 for tier 1 vmware storage.
Seems reasonable. I will keep this in mind when naming later on.

Naming conventions are something that needs to be taught in school.
Yeah, and they probably do that, but I haven't yet gone to any school related to IT or programming.
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
Yeah, and they probably do that, but I haven't yet gone to any school related to IT or programming.
I did and it was notably absent from ALL material and lecture. The only place I got a good dose with my highschool programing class.
 

BloodyBonkers

Dabbler
Joined
Sep 17, 2017
Messages
21
I did and it was notably absent from ALL material and lecture. The only place I got a good dose with my highschool programing class.
That is unfortunate, wouldn't take them much too work to emphasize the importance of a naming convention.
 
Status
Not open for further replies.
Top