Migrate data from pool to new Freenas system

Status
Not open for further replies.

freenastier

Dabbler
Joined
Feb 9, 2017
Messages
20
Hello,

Two years ago I built a small Freenas system to store all kinds of data. I play in a band and one of the members does studio editing of audio recordings. These audio files and video files are now stored on my personal Freenas system. I also use it to store personal files such as documents, family photographs and such.
I had the idea to create an offsite back up, therefore I built a new Freenas system. The old system moves to one of the band members and I keep the new (more energy efficient) system for personal use. The goal is to synchronize data between these systems every weekend for extra protection against major hardware failure.

The new system uses the following hardware:
ASRock J3160DC-ITX (Celeron with AES-NI support)
WD Red WD30EFRX (3 disks for Z1 set-up)
Intel Gigabit CT Desktop Adapter (For reliable gbit networking)
Crucial CT102464BF160B (memory)

My problem is the following. I want my new system to use encryption for storage. The old system did not have encrypted storage. On top of that the old pool contains roughly 4TB of. To make things even more tricky the old system runs on an older Freenas installation. I would like to make the copy before I start updating the old system.

I want to make an identical copy of the storage pool on the old system. Once they are identical I can use send / receive over the internet to keep them in sync efficiently because then only the changes are send.

Questions:
1> How should I make this initial copy to make sure that once the systems are separated on the two sites that there are no problems?

2> Also I am worried that copying over a network takes too long the first time, therefore I might have to add the three new disks to the old system first? Then make a copy and export them before I can finally import them on my new system?

3> Are there any other problems I overlooked?

After some research I think this might be the proper approach / commands for the initial copy:

zfs snapshot -r pool-current@old-system
zfs send -R pool-current@old-system | zfs receive -F pool-new@new-system

Or copy the existing pool to the new disks temprarily added to the old-system for a local copy instead of network transfer:
zfs send -R pool-current@old-system | zfs receive -F pool-new

Am I right?


Any advice is much appreciated!
 
Last edited:

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
Hello,

Two years ago I built a small Freenas system to store all kinds of data. I play in a band and one of the members does studio editing of audio recordings. These audio files and video files are now stored on my personal Freenas system. I also use it to store personal files such as documents, family photographs and such.
I had the idea to create an offsite back up, therefore I built a new Freenas system. The old system moves to one of the band members and I keep the new (more energy efficient) system for personal use. The goal is to synchronize data between these systems every weekend for extra protection against major hardware failure.

The new system uses the following hardware:
ASRock J3160DC-ITX (Celeron with AES-NI support)
WD Red WD30EFRX (3 disks for Z1 set-up)
Intel Gigabit CT Desktop Adapter (For reliable gbit networking)
Crucial CT102464BF160B (memory)

My problem is the following. I want my new system to use encryption for storage. The old system did not have encrypted storage. On top of that the old pool contains roughly 4TB of. To make things even more tricky the old system runs on an older Freenas installation. I would like to make the copy before I start updating the old system.

I want to make an identical copy of the storage pool on the old system. Once they are identical I can use send / receive over the internet to keep them in sync efficiently because then only the changes are send.

Questions:
1> How should I make this initial copy to make sure that once the systems are separated on the two sites that there are no problems?

2> Also I am worried that copying over a network takes too long the first time, therefore I might have to add the three new disks to the old system first? Then make a copy and export them before I can finally import them on my new system?

3> Are there any other problems I overlooked?

After some research I think this might be the proper approach / commands for the initial copy:

zfs snapshot -r pool-current@old-system
zfs send -R pool-current@old-system | zfs receive -F pool-new@new-system

Or copy the existing pool to the new disks temprarily added to the old-system for a local copy instead of network transfer:
zfs send -R pool-current@old-system | zfs receive -F pool-new

Am I right?


Any advice is much appreciated!
Well... I don't know if it would be a good idea to 'add the three new disks in the old system'. Too much chance of something going wrong... like losing all your data! Yikes!

You're on the right track w/ replication. What I suggest is set the two systems up side-by-side to do the initial copy. Yes, it's going to take a while, but you only have to do it once. Then you can move the old system to your friends house. Subsequent snapshots will be much smaller and less time consuming.

Have you thought about how to securely establish a network connection between the two servers?

Good luck!
 

freenastier

Dabbler
Joined
Feb 9, 2017
Messages
20
Hello Spearfoot,

I should copy over the network to the new system instead of doing an initial copy over the much faster s-ata bus? That will take a long time! What if the network connection is unstable or packages are lost / corrupted?
Which network protocol should I use for a fast and reliable transfer the first time?

To secure the connection I am looking into SSH or VPN. I am familiar with SSH and I can probably automate that by authenticating with certificates instead of passwords. Then the systems can synchronize at night in the weekend without any human interaction required.
 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
Hello Spearfoot,

I should copy over the network to the new system instead of doing an initial copy over the much faster s-ata bus? That will take a long time! What if the network connection is unstable or packages are lost / corrupted?
Which network protocol should I use for a fast and reliable transfer the first time?

To secure the connection I am looking into SSH or VPN. I am familiar with SSH and I can probably automate that by authenticating with certificates instead of passwords. Then the systems can synchronize at night in the weekend without any human interaction required.
Yes, SATA is faster than your LAN... And if you're confident you can set up a second pool in the old server without destroying your data, do the transfer, and then move the pool to the new server, then... yes, by all means! Skin the cat that way! :)
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Use replication so your next remote backup can work. Network transfer is just fine also. You can't have corrupt packets and it won't be unstable if you have them plugged into the same switch.

Sent from my Nexus 5X using Tapatalk
 

freenastier

Dabbler
Joined
Feb 9, 2017
Messages
20
My weekend went disastrous. The attempt to copy the existing data to the new same system failed unfortunately.

I started my migration attempts on Friday by taking snapshots from my old dataset:
Code:
zfs snapshot -r existing-volume/directory/dataset-name-1@snapshot-name-1
zfs snapshot -r existing-volume/directory/dataset-name-2@snapshot-name-2
zfs snapshot -r existing-volume/directory/dataset-name-3@snapshot-name-3


Then I tried to send the snapshots with the send / receive command over a SSH network connection, because I considered that to be the easier and safer choice:
Code:
zfs send -Rv existing-volume/directory/dataset-name-1@snapshot-name-1 | ssh destination-ip-address zfs receive -vF new-volume/dataset-name-1


It was a big chunk of data so I had to wait. Unfortunately the process got stuck after a few hours, therefore I had to abort and start over. The second time the process continued but it took many hours. I calculated an average transfer rate of roughly 11,1 megabytes per second. This was a bit disappointing considering the new hardware and I thought it might be the SSH slowing down the transfer speed.

To speed things up I looked for a faster alternative and I tried to use netcat instead to copy the second snapshot:
Code:
At new system: 
nc -l 9000 | zfs receive -vF new-volume


Code:
At old system: 
zfs send -vR 'volume/directory/dataset-name-2@snapshot-name-2' | nc destination-ip-address 9000


Expecting a faster transfer I was a bit disappointed to see no improvement at all. I calculated an average transfer speed of 11,1 megabytes per second again. Then I realized that there was probably a networking problem.
Looking at the shell I saw that the link-speed at both FreeNAS systems was set to 100 mbit. The problem lies in a faulty switch in my home network. This is probably the result of a power-surge a few weeks ago but I did not notice the problem before. I will buy a new gbit switch this week and hope to continue my migration effort soon!

The above is for future reference and hopefully someone finds it useful when they attempt a similar effort on their own. I should have checked the link-speed of the network adapters before I started the send / receive attempts.

I ran however into an other minor problem. The dataset copied with ssh ended up in an additional sub-directory whereas the dataset copied with netcat ended up nicely in the root of the destination volume like this:
with ssh: new-volume/dataset-name-1/dataset-name-1/
with netcat: new-volume/dataset-name-2/

What did I do wrong?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
The destination you specified was different.
For ssh you used new-volume/dataset-name-1 and for nc you used new-volume/. Use just new-volume/ for the ssh and it should do what you want I think.
 
Status
Not open for further replies.
Top