# [ SOLVED ] Move entire installation to another computer



## vanessa (Jan 20, 2014)

Hi all

I am trying to create an extensive list of config files and settings that need to be modified if one takes an installed FreeBSD and copies it to another computer. Meaning not moving the physical HDD but a tar archive of the data only. 

What is obviuos is/are the NIC/s in /etc/rc.conf, /boot/loader.conf and the mounts in /etc/fstab. As long as disks get detected automatically, this should suffice.

But what about other hardware such as storage or USB controllers? Which are the best settings for forcing detection and not using the hints files (or rebuilding them upon each/first boot)?


----------



## wblock@ (Jan 20, 2014)

*Re: Move entire installation to another computer*

Use dump(8) and restore(8) instead of tar(1).

Use ifconfig_DEFAULT to avoid having a custom configuration for different network cards.  See rc.conf(5).
Use GPT or other labels to make disk names static regardless of hardware.  Although I recommend keeping the names unique to each disk.

You should not need hints.  Storage controllers are generally detected by the GENERIC kernel, and should not matter anyway if you use disk labels.


----------



## SirDice (Jan 21, 2014)

*Re: Move entire installation to another computer*



			
				wblock@ said:
			
		

> Use ifconfig_DEFAULT to avoid having a custom configuration for different network cards.  See rc.conf(5).


Thank you very much. That's an interesting one I didn't know about. I'm sure I'm going to make good use of that.  

Would something like ifconfig_DEFAULT_name="net0" work? You could then bind daemons to net0 instead of whatever interface the machine may have. Greatly simplifying configuration management across multiple machines.


----------



## vanessa (Jan 21, 2014)

*Re: Move entire installation to another computer*

Yes, thank you for the good input! A also didn't know about this. However it seems usable with only one NIC. As soon as you have two or more, you'll have to edit rc.conf each time.

What are the benefits of dump(8) and restore(8) compared to tar(1)?


----------



## wblock@ (Jan 21, 2014)

*Re: Move entire installation to another computer*

I don't know if ifconfig_DEFAULT supports multiple cards, either manually with names or with an appended number.  If not, that would be a good addition.

For the dump(8)/restore(8) question, see http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/backup-basics.html, the "Which Backup Program Is Best?" section.  Granted, that is from a long time back, but is there any compelling reason to use something else now?  I've managed to get rsync(1) to duplicate filesystems faithfully, but it took a long series of non-default options, and the only reason I use it is because of the incremental update it provides.


----------



## SirDice (Jan 21, 2014)

*Re: Move entire installation to another computer*



			
				vanessa said:
			
		

> What are the benefits of dump(8) and restore(8) compared to tar(1)?


The biggest advantage is probably incremental backups. You could, for example, make a weekly full backup and daily incremental backups. They work on entire file-systems though, it may not be what you're looking for. With tar(1) you can more easily backup _individual_ files.


----------



## vanessa (Jan 21, 2014)

*Re: Move entire installation to another computer*

What I am actually after is a system preparation on one computer with a simply copying the entire tree to multiple other systems changing only the hardware stuff. So, no backup but replication. 

Are there really no other files to change than the three I mentioned above?


----------



## SirDice (Jan 21, 2014)

*Re: Move entire installation to another computer*



			
				vanessa said:
			
		

> Are there really no other files to change than the three I mentioned above?


That very much depends on what else is running. If you have, for example, apache22 you should probably also copy /usr/local/etc/apache22/. Different daemons may have other specific configuration files. The three files you mentioned are usually enough for the base OS.

If you need to manage multiple machines and need some centralized system to manage them all you should definitely look into sysutils/puppet. I've recently implemented it for an internet company and it works brilliantly. It takes a lot of tinkering though but once it's done you can provision a new server in a couple of minutes. All done automatically.


----------



## vanessa (Jan 22, 2014)

*Re: Move entire installation to another computer*

Thanks a lot! I needed this input urgently because last week two systems crashed (and keep crashing shortly after boot) after copying them this way and I was not sure what the cause was/is. Obviously it is not something I've forgotten of ... 

I will also take a look at  sysutils/puppet


----------

