Easiest way to Migrate with Snapshots

Status
Not open for further replies.

M H

Explorer
Joined
Sep 16, 2013
Messages
98
Thanks in advance for your help. I'm trying to migrate an entire pool to a new pool because I'm transitioning to advanced format drives. (1TB -> 4TB)

What would be the easiest way to move data over while maintaining my datasets and permissions?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Make a current top-level recursive snapshot, recursively replicate to the new pool.
 

M H

Explorer
Joined
Sep 16, 2013
Messages
98
Thank you. Is it best to this via CLI?

Something like this I found in a non-native thread (credit to Dustin Brewer)?

zfs snapshot -r library@full
zfs send -R library@full | zfs receive -Fdv backup

*destroy & recreate library pool*

zfs snapshot -r backup@full
zfs send -R backup@full | zfs receive -Fdv library

I'm just weary and I don't want to run commands I don't fully understand.
 
Joined
Jan 9, 2015
Messages
430
You can do it all through the GUI.
 

M H

Explorer
Joined
Sep 16, 2013
Messages
98
Thanks. Do I need to make a new periodic snapshot that full size? and then clone the resulting snapshot to the new pool?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Not a periodic snapshot. Just a one-time recursive snapshot of the top-level dataset.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
zfs snapshot -r backup@full
I see no reason to do a snapshot on the backup pool. In fact, I think that command will fail because there will already be a snapshot with that name on that pool.
 

M H

Explorer
Joined
Sep 16, 2013
Messages
98
OK, so manually create recursive snapshot. Find that snapshot in ZFS snapshots and clone to new zpool.

Will this also bring over all my datasets? With their respective owners intact? What about set Windows ACLs? Or do I have to manually recreate the sub datasets in my zpool?
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
When you replicate a snapshot everything it contains is preserved, including child datasets if the replication is recursive. However, there's a chance you're confusing datasets with shares. To preserve your shares, make sure you also save a backup of your configuration.
 

M H

Explorer
Joined
Sep 16, 2013
Messages
98
Last question I hope. When I try to clone the snapshot via the GUI, it says that it must be on the same volume (snapshot is on array). I have created a new zpool (called newArray) that I want to set as the destination.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Then you don't want to clone it. You want to replicate it.

Read up on ZFS replication.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
When I try to clone the snapshot via the GUI
I think one of the earlier posts may have led you astray. You can create a one-off snapshot using the GUI but you will have to use the command-line to replicate it (using zfs send and zfs receive commands). The GUI only supports regularly scheduled replication tasks.
 
  • Like
Reactions: M H

M H

Explorer
Joined
Sep 16, 2013
Messages
98
I think one of the earlier posts may have led you astray. You can create a one-off snapshot using the GUI but you will have to use the command-line to replicate it (using zfs send and zfs receive commands). The GUI only supports regularly scheduled replication tasks.
Thank you. I had a feeling that I may have to go the command line route.

So now that I have a recursive snapshot (called arrayFullRecursive) on my zpool called "array" and a new zpool called "newArray," the command should be:

zfs send -R array@arrayFullRecursive | zfs receive -Fdv newArray

?

Thanks.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
I don't think you need the -F on the receive, unless you already sent something to the destination. Really, the only way to be sure is to dry-run the command using the -n option.
 
  • Like
Reactions: M H

M H

Explorer
Joined
Sep 16, 2013
Messages
98
Thank you. I'll give a shot today.
 

M H

Explorer
Joined
Sep 16, 2013
Messages
98
Great! Looks like the stream carried over. Now to confirm, all of my system settings in the system dataset were also migrated correct? So I should be able to just change my system dataset in settings and restart Samba?

I just ask because I've heard hard lessons on changing permissions or references to the system dataset.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
all of my system settings in the system dataset were also migrated correct?
Assuming you're running 9.3, I suggest you delete the .system dataset from the replicated pool, then change the System Dataset pool from the GUI. When you do this in 9.3 it moves the .system dataset to the newly selected pool.

I'm not sure what you mean by "all of my system settings". My understanding is that you preserve all your settings by saving a backup of your configuration.
I've heard hard lessons on changing permissions or references to the system dataset.
Permissions are properties of datasets and the folders and files they contain. They are not stored in the system dataset, nor in your configuration.
 

M H

Explorer
Joined
Sep 16, 2013
Messages
98
So now, I can no longer access any of my snapshots. The GUI will just get stuck at the Loading... Page. Once I was done with the zfs send, I changed one of my share's target over to the array. This caused a panic and the machine rebooted. Now I can longer access the snapshots and zfs commands in CLI just hang.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
I can no longer access any of my snapshots. The GUI will just get stuck at the Loading...
I don't understand the connection between these statements. Are you sure you mean "snapshots".

To recover, use the console menu to reset to factory defaults, then upload a saved configuration from before you made the change that broke it.
 

M H

Explorer
Joined
Sep 16, 2013
Messages
98
I'm going to reload config. Thanks. Is there any reason the machine should crash when changing the focus of share from one pool to another? (I always turn off CIFS first)

Here is what I'm stuck at when loading snapshots:

 
Status
Not open for further replies.
Top