# Migrate host to Jail setup



## xy16644 (May 17, 2015)

I have a server running FreeBSD 10.1-STABLE currently that is mainly used for email. There are no jails on this server.

This weekend I did a bit of reading about Jails. Obviously when I originally built/designed my server I didn't know about Jails so my question is, is it possible to migrate the ENTIRE server into a Jail? So what I would like to have is the host which has no (or very few) daemons running in it, a Jail running my email server and then one or two other Jails used for other tasks (like a NAS). So, if my email server was to be hacked, I wouldn't want them to be able to see my files on the NAS!

Can the host be migrated into a Jail easily? Is this practical to do?

I use ZFS for everything.

Thanks!

PS: Although I have read a bit about Jails this weekend I have yet to setup or configure one!


----------



## Remington (May 17, 2015)

You'll have to create a jail, install software and copy the config/data files to jail.  It's not that difficult.  Use sysutils/ezjail to make jail management much easier.


----------



## xy16644 (May 17, 2015)

I realise that is an option but is there anything else I could do to migrate my host services to the Jail? I have over 200 ports installed and thought there may be an easier/better way!


----------



## Remington (May 17, 2015)

You could try to tar everything in host and untar everything in jail but you risk breaking something.  So better to reinstall everything and copy config/data to jail if you want stability.  Once you have jail setup done then it'll be much easier to migrate ZFS snapshots.


----------

