# Remove setup directory agent old version

**URL:** https://discuss.elastic.co/t/remove-setup-directory-agent-old-version/330244
**Category:** Elastic Security
**Created:** [April 18, 2023, 6:27pm UTC](https://discuss.elastic.co/t/remove-setup-directory-agent-old-version/330244 "2023-04-18T18:27:10Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![GKre](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@GKre](https://discuss.elastic.co/u/GKre)
#### Post date: [April 18, 2023, 6:27pm UTC](https://discuss.elastic.co/t/remove-setup-directory-agent-old-version/330244/1 "2023-04-18T18:27:11Z")

</div>

Hello,

due to the wonderfull help inside this forum i come more and more into the system and i really like what i learn and see.

I had the problem that upgrade of the agent to 8.7.0 did not work like expected.

So i checked the forum and other sources.

I found out that i need to download the archive, extract and move it to the installed agent data directory.

Than i needed to rename it to elastic-agent-fc4a15. This seems to be the name for 8.7.0.  
This info had been shown with elastic-agent upgrade --help.

Well - finally igot the update installed - just needed to call the running agent in the above directory with elastic-agent upgrade 8.7.0.

What i wonder is, if i can delete the "old" directory or even both of the install directories in the data folder?

on linux it is about 1G of data.

Any help with this?

Can i delete the directories in data after upgrading the agent?

---

<div class="post-metadata">

### Author: ![GKre](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@GKre](https://discuss.elastic.co/u/GKre)
#### Post date: [April 18, 2023, 6:33pm UTC](https://discuss.elastic.co/t/remove-setup-directory-agent-old-version/330244/2 "2023-04-18T18:33:44Z")

</div>

... but - myabe i made a misstake.  
Can it be that the upgrade 8.7.0 is only starting the upgrade from scratch?  
i can see in the log that the source had been downloaded again?

---

<div class="post-metadata">

### Author: ![GKre](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@GKre](https://discuss.elastic.co/u/GKre)
#### Post date: [April 19, 2023, 7:35am UTC](https://discuss.elastic.co/t/remove-setup-directory-agent-old-version/330244/3 "2023-04-19T07:35:05Z")

</div>

well my thoughts were to complicated 😉

The root problem was:

- Agent update via fleet management failed.

The simple solution was:

- go on the client
- call elastic-agent upgrade 8.7.0
- wait until finished
- restart agent
- wait for fleet to get the new version

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [May 17, 2023, 7:35am UTC](https://discuss.elastic.co/t/remove-setup-directory-agent-old-version/330244/4 "2023-05-17T07:35:39Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
