The easiest method is to set up a second FreeNAS which is setup with a RAID-Z2 and copy everything to it.
However if that is not possible, following steps can be taken.
NOTE: Assumption is that:
The steps are:
In essence this means:
Take a backup of the system configuration.
Navigate to System.
NOTE: This backup will be needed later, because when TANK is detached, this will lose any share, snapshot and replication settings.
The system dataset needs to be moved off of TANK.
Use the GUI to select a new location other than TANK or TEMP-TANK.
Plug a USB drive into a free USB port.
Navigate to Storage → Pools.
NOTE: The name does not matter.
In this example, it is called sysbackup.
After the new pool is created
Navigate to System → System Dataset.
NOTE: After a while, the System Dataset will be on the new pool.
Navigate to Storage → Pools.
NOTE: The name does not matter.
In this example, it is called backup.
Create a snapshot of the root dataset on the pool to backup.
Navigate to Storage → Pools.
NOTE: An alternate method to take a snapshot is through the CLI.
Open an SSH session to your FreeNAS box as root.
zfs snapshot -r tank@migrate zfs send -R tank@migrate | zfs receive -F backup
This takes a very long time, often hours.
It is recommended to keep the SSH session open until the command completes
It does not give you any info on the progress of the command, but you can check how much data has been written through the normal reports in the Web GUI.
All the data should be on the backup pool.
IMPORTANT: Verify this before continuing.
Navigate to Storage → Pools.
ALERT: This will completely delete all you data on the pool with no chance of recovery!
It is highly recommended that in addition of the backup pool just created, that another copy of the data is saved elsewhere.
The pool only needs to be destroyed if some of the old drives will be reused.
Pull the old drives, and replace with different drives if needed.
Creating the new pool tank as a RAID-Z2 vdev.
Navigate to Storage → Pools.
NOTE: Ensure this is named the same when you recreate it.
SSH in.
Run the copy command in reverse.
zfs send -R backup@migrate | zfs receive -F tank
NOTE: This may take a very long time, often hours.
In the GUI.
Navigate to Storage → Pools.
NOTE: Do not select destroy this time!
By releasing the tank, and importing it again, will result in the pool being re-inventored.
Move the system dataset back to the main pool.
NOTE: If the system drive was used for this backup instead of a separate USB drive, you can skip the detachment steps below.
The steps are exactly the same as in step 2, just select tank instead.
Navigate to System → System Dataset.
NOTE: After a while, the System Dataset will be on the new pool.
After the system dataset is moved back, detach the sysbackup pool, no need to destroy it, and remove the USB flash drive.
NOTE: Everything should be fine.
If not then restore the system configuration.