<commit_before># Upgrading to Buildkite Agent v2

The Buildkite Agent has changed a lot in v2 but upgrade process is straight forward. We'll cover what’s changed and how to upgrade to new agents.

<%= toc %>

## What’s changed

* The default install location has changed from `~/.buildbox` to `~/.buildkite-agent` (although each installer may install in different locations).
* Agents can be configured with [a config file](configuration).
* Agents register themselves with a organization-wide token, you no longer need to create them via the web.
* Agents now have [hooks support](hooks) and there should be no reason to customise the `bootstrap.sh` file.
* There is built-in support for containerizing builds with [Docker and Docker Compose](/docs/guides/docker-containerized-builds).
* There are [installer packages](installation) available for most systems.
* Agents now have [meta-data](agent-meta-data).
* Agent meta-data can be imported from EC2 tags with `--meta-data-ec2-tags`
* Build steps select agents using key/value patterns rather than explicit agent selection.
* There is built-in support for containerizing builds with Docker and Docker Compose
* Windows support
* Ability to specify commands such as `rake` and `make` in your build pipelines instead of a path to a script
* Automatic ssh fingerprint verification
* You can set a priority for the agent. `*priority 5` will have a job assigned to it over an agent with `*priority 4`
* The agent now works better under flakey internet connections by retrying certain API calls
* A new command `buildkite-agent artifact shasum` that allows you to download the shasum of a previously uploaded artifact

## Meta-data and agent targetting

No longer do you select individual agents to run build steps but instead you provide an agent query pattern that's used to select the correct agent.

See the [meta-data documentation](agent-meta-data) for more details.

## Bootstrap customizations

If you customized your `bootstrap.sh` file you should now switch to using hooks to achieve the same results. See our [hooks documentation](hooks) for details on the hooks available.

## Upgrading each project

We recommend upgrading one project at a time to the new agents. This is because you'll need to update your build pipelines to use agent targeting, rather than selecting the individual agents.

To update the agent on a build machine we recommend stopping the agent, removing all the files, and following the [install instructions for your platform](installation).

Once you have the new agent running, update your project’s build pipeline steps to target the new agent, and trigger a build.

## Upgrading a pre-1.0 agent
<commit_msg>Removing duplicate line<commit_after># Upgrading to Buildkite Agent v2

The Buildkite Agent has changed a lot in v2 but upgrade process is straight forward. We'll cover what’s changed and how to upgrade to new agents.

<%= toc %>

## What’s changed

* The default install location has changed from `~/.buildbox` to `~/.buildkite-agent` (although each installer may install in different locations).
* Agents can be configured with [a config file](configuration).
* Agents register themselves with a organization-wide token, you no longer need to create them via the web.
* Agents now have [hooks support](hooks) and there should be no reason to customise the `bootstrap.sh` file.
* There is built-in support for containerizing builds with [Docker and Docker Compose](/docs/guides/docker-containerized-builds).
* There are [installer packages](installation) available for most systems.
* Agents now have [meta-data](agent-meta-data).
* Agent meta-data can be imported from EC2 tags with `--meta-data-ec2-tags`
* Build steps select agents using key/value patterns rather than explicit agent selection.
* Windows support
* Ability to specify commands such as `rake` and `make` in your build pipelines instead of a path to a script
* Automatic ssh fingerprint verification
* You can set a priority for the agent. `*priority 5` will have a job assigned to it over an agent with `*priority 4`
* The agent now works better under flakey internet connections by retrying certain API calls
* A new command `buildkite-agent artifact shasum` that allows you to download the shasum of a previously uploaded artifact

## Meta-data and agent targetting

No longer do you select individual agents to run build steps but instead you provide an agent query pattern that's used to select the correct agent.

See the [meta-data documentation](agent-meta-data) for more details.

## Bootstrap customizations

If you customized your `bootstrap.sh` file you should now switch to using hooks to achieve the same results. See our [hooks documentation](hooks) for details on the hooks available.

## Upgrading each project

We recommend upgrading one project at a time to the new agents. This is because you'll need to update your build pipelines to use agent targeting, rather than selecting the individual agents.

To update the agent on a build machine we recommend stopping the agent, removing all the files, and following the [install instructions for your platform](installation).

Once you have the new agent running, update your project’s build pipeline steps to target the new agent, and trigger a build.

## Upgrading a pre-1.0 agent

{'fraction_non_alphanumeric': 0.05839141081182897, 'fraction_numerical': 0.0030137502354492373, 'mean_word_length': 4.667022411953042, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5609739', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1283, 'n_words': 762}