# Import ZFS Pool from 7.0 After Fresh Install to 8.1



## CsHoSI (Dec 12, 2010)

I have an existing ZFS RAID-Z pool I created in 7.0-RELEASE.  I am having problems with a certain port after doing a portsnap update.   I want to try a fresh install of 8.1-RELEASE.  I do not want to try and go through a build world.

I will have my existing pool data backed up to be safe, but would like to avoid having to copy it all back.  How can I mount an existing, older version ZFS RAID-Z array on a fresh install?  I do not really need to have the newer version file system for the updated features of ZFS at this time.  The stability fixes will be enough for me.  This is only a data storage array, it is not what the system boots from.

Sorry for being a noob, I have read about ZFS upgrades being fine after building world, but I did not see anything specific on a fresh install.  

Reading the Manpages for zpool, it seems like I need to export the ZFS pool first on the old system, then import it once the new system is installed.  Is that all there is to it?  I do not need to backup any exported pool configuration data, or specify the drives that make up the pool again?

Thanks for looking, hope it's as easy as it sounds.


----------



## shitson (Dec 12, 2010)

Yep, should be as simple as 


```
zpool export pool
```

move the devices to the new system then


```
zpool import
...
zpool import poolname
```

Just make sure you heed the information given in the zpool man page that your disks use the entire disk etc to be portable

Good luck!


----------



## SIFE (Dec 12, 2010)

First export your pool then import it after fresh install, plus I don't know if this will work with zfs raid:

```
zpool export <your pool>
zpool import <your pool>
```
if any warning message type:

```
zpool import -f
zfs mount -a
```


----------



## CsHoSI (Dec 12, 2010)

OK, great.  I thought with ZFS it would be that easy!  I guess it scans the disks looking for members of the exported pool.  I saw that about using the entire disk and I do.

Thank you!


----------



## phoenix (Dec 13, 2010)

Corrections for the above posts:

On the 7.0 system, so long as the pool is not where the OS is installed, you need to export the pool, thus making it available for importing on other systems:
`# zpool export <poolname>`

On the 8.1 system, you need to set your hostid first:
`# /etc/rc.d/hostid start`

Then you can import the pool:
`# zpool import <poolname>`

Once that is done, you can add *zfs_enable="YES"* to /etc/rc.conf so that the pool is imported automatically at boot.

You do not need to upgrade the ZFS pool version, nor the filesystem versions, until you are sure everything is working and you are going to stay with FreeBSD 8.1 or newer.  Once you upgrade a pool, you can no longer import it using ZFS binaries from older versions.

Technically, the export step is not needed, as you can always force an import.  However, it keeps things cleaner if you do things in the right order.  Just as, technically, the hostid step isn't needed, but it makes things a lot cleaner/simpler/nicer if you do it.


----------

