# Sensu Upgrade 5.21 -> 6.3 Notes

### Places where code might need to be upgraded for a new version 
- Official [Sensu Go Repo Github](https://github.com/sensu/sensu-go)
- Official [Sensu Go Website](https://sensu.io/)
- Official Sensu Hosted Package Repo Service [Packagecloud](https://packagecloud.io/sensu/stable/)

> :warning: We will use our XDR Internal `Reposerver` for all upgrade methods - See [How to add a new package to the Reposerver](Reposerver%20Notes.md)


### Sensu Go Upgrade to 6.3
[Jira MSOCI-1565 ticket - Upgrade Sensu to 6.2.X](https://jira.xdr.accenturefederalcyber.com/browse/MSOCI-1565)

Initial Ticket:
```
Sensu 6.1.3 breaks the ability for Sensu to use the proxy. This issue ( hopefully) is fixed in 6.2.0. 

https://github.com/sensu/sensu-go/issues/4101

https://github.com/sensu/sensu-go/pull/4113/files

Done When: Sensu is upgraded to 6.2.0 
```

Ticket Update: [Decision to upgrade to 6.3](https://jira.xdr.accenturefederalcyber.com/browse/MSOCI-1565?focusedCommentId=44245&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-44245)


Ticket conclusion: [Sensu Go GC Test and Prod env had been upgraded 100% to 6.3](https://jira.xdr.accenturefederalcyber.com/browse/MSOCI-1565?focusedCommentId=44564&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-44564)

```
[Conclusion]:

    GC Test and Prod envs are both running Sensu Go 6.3 at both the 'backend', 'cli' and 'agents' from Sensu to 'entities'. 
    We have not observed any issues within the XDR env pertaining to this upgrade.
    Sensu Go 6.3 has introduced some newer features within the GUI that we are currently exploring usage of.
```

[Sensu Upgrade Documentation](https://docs.sensu.io/sensu-go/latest/operations/maintain-sensu/upgrade/) - as of June 17, 2021, `Sensu Go 6.3` is not being displayed in the Sensu documentation, but procedure still applies.

1. Download latest packages for `Sensu backend`, `Sensu agents`, `Sensuctl` (Sensu CLI) to `Repo server` and run `yum clean all` on `Sensu Backend` server - See [Reposerver](Reposerver%20Notes.md) notes.

2. If needed, update Salt states to ensure they are up-to-date 
3. Stop Sensu services on `Sensu Backend` server
    ```
    systemctl stop sensu-agent 
    systemctl stop sensu-backend
    ```

4. Update Sensu Go software on the `Sensu Backend` server
   ```
   yum update sensu-go-backend
   yum update sensu-go-cli
   yum update sensu-go-agent
   systemctl daemon-reload
   ```
5. Restart the Sensu services 
    ```
    systemctl start sensu-backend
    systemctl start sensu-agent
    ```
6. Run `yum clean all` on Salt minions
7. Stop agent on minion `systemctl stop sensu-agent`
8. Upgrade agent on minion `yum update sensu-go-agent -y`
9. Run this `systemctl daemon-reload`
10. Start agent `systemctl start sensu-agent`
11. Verify with this: 
    ```
    salt '*' cmd.run 'sensu-agent version'
    salt -C '* not salt* not sensu* not jira*' cmd.run 'sensu-agent version'
    ```

In `version 5.16` the default password was removed in favor of a sensu-backend init with bash variables. 

Sen$uP@ssw0rd!

```
systemctl start sensu-backend
export SENSU_BACKEND_CLUSTER_ADMIN_USERNAME=YOUR_USERNAME
export SENSU_BACKEND_CLUSTER_ADMIN_PASSWORD=YOUR_PASSWORD
sensu-backend init
sensuctl create --file filename.json
```