The Ops Agent is now Generally Available. The GA version incorporates fixes and
improvements based on the feedback from Preview users. This guide provides
migration steps for the following users:

- Ops Agent Preview users to migrate to the GA version of the agent.

- Users of the legacy Logging and Monitoring
  agents to migrate to the Ops Agent.

## Migrating from Ops Agent Preview to the GA version

To install the latest version of the Ops Agent, complete the
[Upgrading the agent](https://docs.cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/installation.md.txt#upgrade) procedures.

If you edited the agent's default configuration to remove the
`default_pipeline`, add the following snippet to the [agent
configuration](https://docs.cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/configuration) to
keep that pipeline disabled:

    logging:
      service:
        pipelines:
          default_pipeline:
            receivers: []
            exporters: []
    metrics:
      service:
        pipelines:
          default_pipeline:
            receivers: []
            exporters: []

### Changes in commands for managing the Ops Agent

The following table lists the commands for managing the agent that changed for
the GA release:

| Procedure | GA version | Preview version |
|---|---|---|
| Starting the agent | `sudo service google-cloud-ops-agent start` | N/A |
| Stopping the agent | `sudo service google-cloud-ops-agent stop` | N/A |
| [Restarting the agent](https://docs.cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/installation.md.txt#restart) | `sudo service google-cloud-ops-agent restart` | `sudo systemctl restart google-cloud-ops-agent.target` |
| [Checking agent status](https://docs.cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/troubleshoot-install-startup.md.txt#systemd-not-running) | `sudo service google-cloud-ops-agent status` | `sudo systemctl status google-cloud-ops-agent.target` |

## Migrating from the legacy agents to the Ops Agent

To migrate from the legacy Logging and Monitoring
agents, complete the following steps.

1. Uninstall the [Logging](https://docs.cloud.google.com/logging/docs/agent/logging/installation.md.txt#uninstall)
   and the [Monitoring](https://docs.cloud.google.com/monitoring/agent/monitoring/installation.md.txt#uninstall)
   agents.

   After you uninstall the agent, the Google Cloud console might take up to one
   hour to report this change.
2. Install the latest version of the [Ops Agent on a single virtual
   machine](https://docs.cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/installation#install-latest-version).

   You also have the option of [installing and managing the Ops Agent on
   multiple VMs](https://docs.cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/install-index).
3. [Configure the Ops Agent](https://docs.cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/configuration.md.txt)
   as needed.

## Differences in how metrics are collected

The following table describes differences in the data ingested by the Ops Agent and the legacy Monitoring agent.

| Metric type, omitting `agent.googleapis.com` | Ops Agent (GA)^†^ | Ops Agent (Preview)^†^ | Legacy Monitoring agent |
|---|---|---|---|
| [`cpu_state`](https://docs.cloud.google.com/monitoring/api/metrics_agent.md.txt#cpu/utilization) | The possible values for Windows are `idle`, `interrupt,` `system` and `user`. | The possible values for Windows are `idle`, `interrupt,` `system` and `user`. | The possible values for Windows are `idle` and `used`. |
| [`disk/bytes_used`](https://docs.cloud.google.com/monitoring/api/metrics_agent.md.txt#disk/bytes_used) and [`disk/percent_used`](https://docs.cloud.google.com/monitoring/api/metrics_agent.md.txt#disk/percent_used) | Ingested with the full path in the `device` label; for example, `/dev/sda15`. Not ingested for virtual devices like `tmpfs` and `udev`. | Ingested without `/dev` in the path in the `device` label; for example, `sda15`. Ingested for virtual devices like `tmpfs` and `udev`. | Ingested without `/dev` in the path in the `device` label; for example, `sda15`. Ingested for virtual devices like `tmpfs` and `udev`. |

^†^ The **GA** column refers to Ops Agent versions 2.0.0 and higher. The **Preview** column refers to Ops Agent versions less than 2.0.0.