# Carrying the ports' options to a fresh installation



## choosy23 (Jan 13, 2013)

Hi,

I am not sure if this is a clean solution, or if there is a better way to do it, that is why I ask.

I had FreeBSD 9.0-RELEASE on my laptop, on which I have configured and installed the needed ports. I have upgraded with portmaster to 9.1-RELEASE.

Now I want to do a complete reinstall of 9.1-RELEASE (for switching to zfs) but I want to preserve the ports' options that I have configured recently. My idea is to backup /var/db/ports and then copy it over to the newly installed system.

From my understanding, when I will compile the ports on the new system, the options will be taken from /var/db/ports so I won't have to configure them again.

Is this a good approach? Is there anything else I need to do?

Thank you,
Stefan


----------



## wblock@ (Jan 13, 2013)

Yes, copying /var/db/ports should work.  Copying /usr/local/etc for modified config files is a good idea.


----------



## wblock@ (Jan 13, 2013)

Another way of doing that upgrade would be backing up everything with dump(8), redoing the drive into ZFS, and then restoring from the dump file.  Although I have not tested restoring onto ZFS, I suspect it would work.  Backup Options For FreeBSD has usage information.

If not, there's net/rsync to copy from an old filesystem onto the new disk.  Be careful about the options, it needs several to copy FreeBSD filesystems correctly.  I use -axHAXS --delete --fileflags --force-change.  Some of those probably won't work on ZFS.


----------

