---
agentTools:
  projectIndex: https://docs.project-fifo.net/llms.txt
---

# Upgrading FiFo AIO Dataset

FiFo Upgrade Guide

[block:callout]
{
  "type": "danger",
  "body": "It is highly advisable that you make a snapshot of your *FiFo Zone delegated dataset* before updating. While the procedure should be safe it is always better to remain on the side of caution."
}
[/block]

## Zone

Upgrading a FiFo AIO zone is as easy as reprovisioning.

[block:code]
{
  "codes": [
    {
      "code": "imgadm avail | grep fifo\nimgadm import b67e58ba-b4f1-4a99-98d4-0df132a57343\necho '{\"image_uuid\": \"b67e58ba-b4f1-4a99-98d4-0df132a57343\"}' | vmadm reprovision FIFO_ZONE_UUID\nvmadm list # check to make sure vm state = running (may take a minute or two)\nzlogin FIFO_ZONE_UUID",
      "language": "shell"
    }
  ]
}
[/block]

Start the fifo services:

[block:code]
{
  "codes": [
    {
      "code": "svcadm enable epmd\nsvcadm enable snarl\nsvcadm enable howl\nsvcadm enable sniffle\nsleep 10 #wait for services to try starting\nsvcs -xv",
      "language": "shell"
    }
  ]
}
[/block]

## Hypervisors

There are two ways to update the server on the hypervisor.

1. Connect to the hypervisor and run:

[block:code]
{
  "codes": [
    {
      "code": "/opt/chunter/bin/update -u",
      "language": "shell"
    }
  ]
}
[/block]

It's always good to confirm [Chunter](https://docs.project-fifo.net/docs/chunter) is running:

[block:code]
{
  "codes": [
    {
      "code": "svcs chunter\nSTATE          STIME    FMRI\nonline         21:16:28 svc:/network/chunter:default",
      "language": "shell"
    }
  ]
}
[/block]

2. Use `fifoadm` to update a hypervisor by running:

[block:code]
{
  "codes": [
    {
      "code": "fifoadm hypervisors update",
      "language": "shell"
    }
  ]
}
[/block]

This will trigger all hypervisors to update.

## Converting from older installations

Older installations don't have a delegate dataset and don't store data in the `/data/` partition. While this makes a direct update vie the AIO dataset not possible there is a procedure to convert a old dataset to one that can be upgraded via the AIO dataset.

The process involves multiple steps and it's **IMPORTANT** to make a backup of the data prior to starting it!

### Adding a delegate

While `vmadm` does not support adding delegates it is possible with the following commands

[block:code]
{
  "codes": [
    {
      "code": "ZONE=0d2b7f71-e4f8-ca89-bfc5-d9017220e19f\nzfs create zones/${ZONE}/data\ncat <<EOC | zonecfg -z ${ZONE}\nadd dataset\nset name=zones/${ZONE}/data\nend\nverify\ncommit\nEOC\necho '{\"indestructible_delegated\":true}' | vmadm update ${ZONE}\nvmadm reboot ${ZONE}",
      "language": "shell"
    }
  ]
}
[/block]

Notice that the vm needs to be rebooted for this.

### Moving the data onto the delegate

At this point all FiFo services need to be disabled on the node.

[block:callout]
{
  "type": "danger",
  "title": "existing /data folder",
  "body": "Make sure before mounting the data directory the 'old' /data is out of the way! this can be done by running `mv /data /data.old`. And then copying the old content back onto the new mount!"
}
[/block]

How to put the delegate into the right place can be found in the [Installing FiFo](https://docs.project-fifo.net/docs/installing-fifo). Once the delegate is in place the next task is to move the data. In the old system FiFo put the data in `/var/db/` and `/var/log/` now it's in `/data`.

[block:parameters]
{
  "data": {
    "h-0": "Old",
    "h-1": "New",
    "0-0": "`/var/db/sniffle`",
    "0-1": "`/data/sniffle/db`",
    "1-0": "`/var/log/sniffle`",
    "1-1": "`/data/sniffle/log`",
    "2-0": "`/var/db/snarl`",
    "2-1": "`/data/snarl/db`",
    "3-0": "`/var/log/snarl`",
    "3-1": "`/data/snarl/log`",
    "4-0": "`/var/db/howl`",
    "5-0": "`/var/log/howl`",
    "4-1": "`/data/howl/db`",
    "5-1": "`/data/howl/log`",
    "6-0": "`/var/log/leo_*`",
    "6-1": "`/data/leo_*/log`",
    "7-0": "`/var/db/leo_*`",
    "7-1": "`/data/leo_*/db`"
  },
  "cols": 2,
  "rows": 8
}
[/block]

The directories in `/data/`  and all their subdirectories need to be owned by the respective user and the home directories in `/etc/passwd` should be adjusted accordingly.

### Updating the config

The config file in `/data/<serivce>/etc/<service>.conf` will still point to the `/var/db` and `/var/log` directories, this needs to be changed too. Once that is done the can be started manually one by one using `<service> console` to verify everything is working, `CTRL+C+C`

Once verified everything works the services can be enabled again.