Backing Up and Recreating Zones

This section provides procedures to back up files in zones and the zone configuration file, and to use a saved configuration file to recreate the zone.

Note:

On a system with zones on shared storage, archive and deploy each global or non-global zone separately. See How to Archive a System That Contains Zones on Shared Storage in Using Unified Archives for System Recovery and Cloning in Oracle Solaris 11.4.

Example 7-1 Using Unified Archives to Back Up a System With Zones

The following example creates a recovery archive of the zone my-zone to /net/server/my-zone-archive.uar.

host1$ pfbash archiveadm create -r -z my-zone /net/server/my-zone-archive.uar

Example 7-2 Printing a Copy of a Zone Configuration

The administrator creates a backup file of the non-global zone configuration at first login after responding to the sysidtool questions. The administrator plans to use the backup later to create the zone again.

global$ pfbash zonecfg -z my-zone export > /net/server/my-zone-configtemplate.txt

Example 7-3 Recreating a Non-Global Zone

The administrator follows these steps to recreate my-zone from the files in Example 7-2 and Example 7-1.

  1. Uses the configuration file to configure the zone.

    host2$ pfbash zonecfg -z my-zone -f /net/server/my-zone-configtemplate.txt
  2. Uses the archive to install the zone.

    host2$ zoneadm -z my-zone install -a /net/server/my-zone-archive.uar