# Understanding when cht-core upgrades occur via horti-upgrade documents

**URL:** <https://forum.communityhealthtoolkit.org/t/understanding-when-cht-core-upgrades-occur-via-horti-upgrade-documents/2682>\
**Category:** Technical Support\
**Created:** [April 24, 2023, 7:53pm UTC](https://forum.communityhealthtoolkit.org/t/understanding-when-cht-core-upgrades-occur-via-horti-upgrade-documents/2682 "2023-04-24T19:53:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kenn](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/kenn/32/55_2.png) [@kenn](https://forum.communityhealthtoolkit.org/u/kenn)\
**Post date:** [April 24, 2023, 7:53pm UTC](https://forum.communityhealthtoolkit.org/t/understanding-when-cht-core-upgrades-occur-via-horti-upgrade-documents/2682/1 "2023-04-24T19:53:18Z")

</div>

I’m looking for `horti-upgrade` documents to understand when CHT-Core upgrades have happened on a production instance. I’m not seeing any such documents on the CHT 4.1 instance I’m inspecting.

I’m looking using:

[https://instance/medic/\_all\_docs?startkey="horti-"&endkey="i"](https://instance/medic/_all_docs?startkey=%22horti-%22&endkey=%22i%22)

I can see tombstones of this document on CHT 3 instances but not on the CHT 4 instance I’m inspecting.

Is this upgrade record still available?

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [April 24, 2023, 8:05pm UTC](https://forum.communityhealthtoolkit.org/t/understanding-when-cht-core-upgrades-occur-via-horti-upgrade-documents/2682/2 "2023-04-24T20:05:13Z")

</div>

Hi @kenn

Thanks for bringing this up, as I am just now realizing we missed documenting how upgrades can be tracked now. I’ll create an issue to add documentation.

In short, there is no more horti, and therefore, no more `horti-upgrade`. Upgrade logs are kept in a new type of document that you can find in `medic-logs`, and will look like `upgrade_log:<timestamp>:<version>`. You can get them using a similar query:

[https://instance/medic-logs/\_all\_docs?startkey=“upgrade\_log”&endkey=“upgrade\_log\ufff0”](https://instance/medic-logs/_all_docs?startkey=%22upgrade_log%22&endkey=%22upgrade_log%5Cufff0%22)

Can you please give this a try?  
Thanks!

---

<div class="post-metadata">

**Author:** ![kenn](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/kenn/32/55_2.png) [@kenn](https://forum.communityhealthtoolkit.org/u/kenn)\
**Post date:** [April 24, 2023, 8:39pm UTC](https://forum.communityhealthtoolkit.org/t/understanding-when-cht-core-upgrades-occur-via-horti-upgrade-documents/2682/3 "2023-04-24T20:39:04Z")

</div>

That worked! Thanks.

One piece of feedback is that it was very nice to have these upgrade logs available in Postgres via couch2pg.

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [April 24, 2023, 8:39pm UTC](https://forum.communityhealthtoolkit.org/t/understanding-when-cht-core-upgrades-occur-via-horti-upgrade-documents/2682/4 "2023-04-24T20:39:24Z")

</div>

Are `medic-logs` not synced to postgres?

---

<div class="post-metadata">

**Author:** ![kenn](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/kenn/32/55_2.png) [@kenn](https://forum.communityhealthtoolkit.org/u/kenn)\
**Post date:** [April 24, 2023, 8:43pm UTC](https://forum.communityhealthtoolkit.org/t/understanding-when-cht-core-upgrades-occur-via-horti-upgrade-documents/2682/5 "2023-04-24T20:43:27Z")

</div>

[Don’t think so](https://github.com/medic/cht-couch2pg/search?q=medic-logs)

Opened [Sync medic-logs database to Postgres · Issue #131 · medic/cht-couch2pg · GitHub](https://github.com/medic/cht-couch2pg/issues/131)

---

<div class="post-metadata">

**Author:** ![kenn](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/kenn/32/55_2.png) [@kenn](https://forum.communityhealthtoolkit.org/u/kenn)\
**Post date:** [July 10, 2023, 11:16pm UTC](https://forum.communityhealthtoolkit.org/t/understanding-when-cht-core-upgrades-occur-via-horti-upgrade-documents/2682/6 "2023-07-10T23:16:21Z")

</div>

Added in cht-couch2pg 3.6.2. [This query](https://github.com/medic/cht-app-monitoring-data-ingest/pull/93/files#diff-98df5bd874c82cfe080648af7d1ef67cf423f20206927db883ba5857f079fcf3R46) merges 3.x upgrade logs and 4.x upgrade logs into one upgrade history.
