How to Migrate to New Pool Without Starting Repliccation From Scratch?

monovitae

Explorer
Joined
Jan 7, 2015
Messages
55
Ok so here's the situation. I've got 2 FreeNas Servers one primary and one offsite backup. I have DataSetA on Tank1 On the Primary Server. Everynight it automatically takes a snapshot and replicates to the Backup Server.

PrimaryServer/Tank1/DatasetA -----> BackupServer/Tank1/DatasetA

Works great pretty simple. However, now on the Primary Server I'm running out of pool space and I've created a new pool with extra disks that I want to Migrate DataSetA to(which i was just thinking of doing a local zfs send and zfs recv). So now I want to have the auto snapshots and replication look like this.

PrimaryServer/Tank2/DatasetA ----> BackupServer/Tank1/DatasetA

But I don't want to have to redo the replication from scratch as none of the data has changed(its just moved to new hard drives in the primary server) and the data link is long distance WiFi and I only get like 40mbps.

Is there some way for me to acheive this migration to new disks without transfering all of the data over to the backup server again?
 

phomchick

Dabbler
Joined
Oct 2, 2017
Messages
26

monovitae

Explorer
Joined
Jan 7, 2015
Messages
55
Transfer your data to a bigger pool, but don’t change the name of the pool.
https://www.ixsystems.com/community/threads/howto-migrate-data-from-one-pool-to-a-bigger-pool.40519/

Thanks you for the quick reply and idea. I'm not sure it applies in my case however as I perhaps oversimplified things in my original post.

The original pool EG(PrimaryServer/Tank1) has multiple other datasets that are shared and replicated as well, and will remain in use. I'm just trying to move PrimaryServer/Tank1/DatasetA over to PrimaryServer/Tank2 because it is the largest dataset.
 

monovitae

Explorer
Joined
Jan 7, 2015
Messages
55
So in case anyone else is runs into this it was simpler than I thought. However, I was definitely taking a shot in the dark on what I did. I never did find a definitive answer here or on google so here goes.

First things first. Used GUI to create tank2, no big deal. Then got into the CLI and manually replicated the dataset and snapshots over to tank2
zfs send -R tank1/deathstar/ahg/media@auto-20191008.2300-30d | pv | zfs recv tank2/media
Let that run overnight FYI for anyone that cares 6WDReds in Z2 to 6WD Reds in Z2 did 12.1 TB in 10 Hours 343MB/S. Then next morning another periodic snapshot of the original dataset had occured so i sent an incremental snapshot zfs send -i tank1/deathstar/ahg/media@auto-20191007.2300-30d tank1/deathstar/ahg/media@auto-20191008.2300-30d | pv | zfs recv tank2/media

So at this point I had 2 set of the data on two different tanks on the first server. Now on the backup server I had the dataset nested so I wanted to move it over to its own location. This was simpler than I expected.
zfs rename vault/deathstar/ahg/media vault/media This is instant no data transfer required since its the same tank.


Then Back in the GUI on the primary server I created a new periodic snapshot for tank2/media, and setup a replication to the backup server. Forced the replication because at this point I had my fingers crossed and didn't want to wait.
python /usr/local/www/freenasUI/tools/autorepl.py

And boom it replicated the incremental snapshot over to backup and everything was golden.

In retrospect fairly painless, and there may be a better way.
Thank being said, if I was dealing with more important data or didn't have seperate backups I never would have attemped this with the information I had available prior to trying it.
 
Top