# Copying FreeBSD to larger disk



## balanga (Jul 24, 2017)

I have a FreeBSD installation which I want to copy to a larger disk. I've already installed base FreeBSD on the new disk and updated /etc/fstab and the disk boots up OK.

What do I need to copy to the new disk? 

/usr/local
/root
/var

parts of /etc

?

Is there an established procedure for doing this?


----------



## SirDice (Jul 24, 2017)

I wouldn't copy anything besides the home directories (/home and /root). And perhaps a few configuration files you need on the new system.


----------



## KdeBruin (Jul 24, 2017)

I've done something similar while doing a fresh install of FreeBSD 11.0. I just copied the ZFS filesystems using `zfs send` and `zfs receive` to another pool, started the install and let it reformat the boot drive, and copied any files from the backup that I needed.

If it is possible to attach both disks and you don't mind the extra time, do something similar. Positive side effect is that you get rid of lots of unused packages.


----------



## balanga (Jul 24, 2017)

SirDice said:


> I wouldn't copy anything besides the home directories (/home and /root). And perhaps a few configuration files you need on the new system.



What about all the installed pkgs?


----------



## SirDice (Jul 24, 2017)

balanga said:


> What about all the installed pkgs?


Just get a list of installed packages on the 'old' server and install those on the new server. Doing it this way will make sure the packages are all correctly installed on the new server.


----------



## balanga (Jul 24, 2017)

SirDice said:


> Just get a list of installed packages on the 'old' server and install those on the new server. Doing it this way will make sure the packages are all correctly installed on the new server.



So what happens with all web pages, applications and configuration which has been developed over the last couple of years?


----------



## SirDice (Jul 24, 2017)

Well, you created it, so you know what's been changed. This will be a good opportunity to document all the changes that are necessary to get the server up and running again.


----------



## CyberCr33p (Jul 25, 2017)

Use dump and restore.


----------

