# So I want to upgrade my storage... What's the best way to backup my stuff?



## papelboyl1 (May 29, 2012)

I currently have  4x 1TB setup in raidz1. And I want to upgrade them to 4x 3TB. I've been looking at ways to back up my current pool so I can easily transfer them to the new pool.

I've look*ed* at snapshots and this seems unusable since I am using a new pool. The only solution I can think of after searching the net is to rsync all the files to my spare 2TB and once the new pool is created, transfer the files from spare HDD to the new pool.

Does anyone have a better idea? Thank you.


----------



## gkontos (May 29, 2012)

Why don't you send a snapshot of your data to your spare 2TB instead of using rsync?


----------



## papelboyl1 (May 29, 2012)

gkontos said:
			
		

> Why don't you send a snapshot of your data to your spare 2TB instead of using rsync?



Reading various documents, I have an impression that I can only restore to the original pool (i.e. the 4x1TB) pool. Maybe I was mistaken?


----------



## kpa (May 29, 2012)

The question is, do want to preserve snapshots exactly as they are on the main pool? If you do then you need to use a backup ZFS pool that matches the main pool almost exactly and use zfs send, zfs receive. If you don't care about snapshots but just the files as they are at the time of back up then net/rsync is just as good solution.


----------



## Sebulon (May 29, 2012)

@papelboyl1

It is completely possible to send a snapshot from one pool to another, no problemo.

Another way to go about it is to replace the disks one by one and when the last drive is replaced, zfs automatically expands the storage available. No copying or transferring needed. Just make sure to do this first:
`# zpool set autoexpand=on poolname`

It would otherwise require a export/import before it expands.

Although, if you created the raidz vdev with ashift=9, you will be better off creating a new pool with that property set to ashift=12 instead, and then send/recv over to the new pool. Run:
`# zdb | grep ashift`
To see how your current pool is configured.

/Sebulon


----------



## papelboyl1 (May 29, 2012)

So these commands are fine. Right?

```
#zfs send -R mypool1 | cat > /mnt/mysparehdd/backup
#zfs recv mynewpool < /mnt/sparehdd/backup
```


----------



## gkontos (May 29, 2012)

papelboyl1 said:
			
		

> So these commands are fine. Right?
> 
> ```
> #zfs send -R mypool1 | cat > /mnt/mysparehdd/backup
> ...



You might want to also use the -F and -d switch when receiving. See the man pages for zfs(8)().


----------



## phoenix (May 29, 2012)

Don't pipe them into cat.  Just redirect the output to a file:
`# zfs send <options> <poolname>@<snapshot> > /some/path/somefile`

And the reverse:
`# zfs recv <options> <poolname> < /some/path/somefile`


----------

