Since I wasn’t happy with my hosting provider anymore I chose to switch to a local data center.

Migrating multiple hosts with multiple jails isn’t very scalable, so here’s a script to help you with that.

You can easily automate that using ansible if have a larger number of hosts.

I suggest you use ZFS, otherwise change the compression format from .xz to .txz (in the for loop an import script).

On the source host

Export all jails from on the source host:

for jail in $(bastille list | tail -n +2 | awk '{print $1}'); do bastille export --xz "$jail"; done
scp /usr/local/bastille/backups/* root@newhost:/usr/local/bastille/backups/

On the target host

You need to install bastille first. I like the following howto for that

You can simply run

fetch && chmod +x && ./

or create the script by yourself if you don’t trust me:


# configure the export type

# specify the directory to list files from

# file to store processed filenames

touch "$processed_backups"

# loop through all files in the directory with extension target_type
for file in "$backups"/*"$target_type"; do
  # check if the filename has already been processed
  if ! grep -q "^${file}$" "$processed_backups"; then
    # add the filename to the processed file
    echo "$file" >> "$processed_backups"
    # run the bastille import command for the file
     bastille import "$file"

# remove the processed backups file
rm "$processed_backups"


NOTE: You might want to backup your pf.conf if you use public IPs rather then rdr/*