docs-site/content/guide/updating-typesense.md
Before updating Typesense versions, please make sure you've read the release notes for each of the versions since the one you'll be upgrading from.
While we strive hard to minimize any breaking changes between versions, sometimes there might be behavior changes or changes to defaults that might affect search behavior. So we recommend testing version upgrades in a staging environment, before updating your production environment.
We'd also recommend having a set of test search terms and expected results that you can use to verify behavior changes between versions.
[[toc]]
If you're running Typesense on Typesense Cloud:
Once the upgrade is complete, you will receive an email notification to the Cluster Alerts email address you've set in your account page.
We support the following configuration changes in Typesense Cloud:
For all other types of configuration changes, you would have to provision a new cluster with the desired configuration and reindex your data in it.
For clusters that have High Availability enabled and/or Search Delivery Network enabled: the upgrade will happen one node at a time. So the other nodes in the cluster will continue to serve traffic and you should see a zero-downtime upgrade. Learn more here about all the scenarios when HA helps.
:::warning IMPORTANT When you have a cluster with High Availability enabled, you want to ensure that you have also configured your client libraries as described here with all the hostnames you see in your cluster dashboard, before triggering the config change. :::
For single-node non-HA clusters: there will be a downtime of about 5-60 minutes depending on the size of your dataset while the upgrade happens. You want to enable HA on your cluster to avoid this downtime. Note that once HA is enabled on a cluster it cannot be turned off.
The process of updating Typesense is simple - install the new version of Typesense and restart the server. You won't need to re-index any of your documents. Typesense will automatically use the raw data from disk and rebuild the in-memory indices on the new version as needed.
So if you used the Docker image, just stop the running container, then run docker run with the new version. Make sure you pass the same arguments to docker run as before.
If you installed Typesense with one of the prebuilt binaries or from one of the package managers, just download the new version of Typesense, replace the binary, or use the package manager to upgrade the DEB/RPM and restart the process.
If you've deployed Typesense in a multi-node Highly Available configuration, you can do zero-downtime upgrades by doing a rolling upgrade.
To do this, you want to make sure you update one node at a time, wait until the /health endpoint responds with the status code 200 on the node you just updated, before updating the next node.
During the upgrade, you want to ensure that the leader of the cluster is using the older Typesense version.
In other words, you want to upgrade each of the followers first and the leader last.
You can determine whether a node is a leader or follower by the value of the state field in the <RouterLink :to="`/${$site.themeConfig.typesenseLatestVersion}/api/cluster-operations.html#debug`">/debug</RouterLink> end-point response.
| State | Role |
|---|---|
| 1 | LEADER |
| 4 | FOLLOWER |
/health should return healthy).docker run -p 8108:8108
-v"$(pwd)"/typesense-data:/data typesense/typesense:{{ $site.themeConfig.typesenseLatestVersion }}
--data-dir /data
--api-key=$TYPESENSE_API_KEY
--enable-cors</code></pre>
</div>
</template>
</Tabs>
curl -O https://dl.typesense.org/releases/{{ $site.themeConfig.typesenseLatestVersion }}/typesense-server-{{ $site.themeConfig.typesenseLatestVersion }}-1.aarch64.rpm sudo yum install ./typesense-server-{{ $site.themeConfig.typesenseLatestVersion }}-1.aarch64.rpm
sudo systemctl restart typesense-server.service</code></pre> </div> </template> </Tabs>
curl -O https://dl.typesense.org/releases/{{ $site.themeConfig.typesenseLatestVersion }}/typesense-server-{{ $site.themeConfig.typesenseLatestVersion }}-arm64.deb sudo apt install ./typesense-server-{{ $site.themeConfig.typesenseLatestVersion }}-arm64.deb
sudo systemctl restart typesense-server.service</code></pre> </div> </template> </Tabs>
curl -O https://dl.typesense.org/releases/{{ $site.themeConfig.typesenseLatestVersion }}/typesense-server-{{ $site.themeConfig.typesenseLatestVersion }}-linux-arm64.tar.gz tar -xzf typesense-server-{{ $site.themeConfig.typesenseLatestVersion }}-linux-arm64.tar.gz
mv ./typesense-server $PATH_TO_EXISTING_BINARY
kill <TYPESENSE_PROCESS_ID> # will gracefully shutdown
export TYPESENSE_API_KEY=xyz ./typesense-server --data-dir="$(pwd)"/typesense-data --api-key=$TYPESENSE_API_KEY --enable-cors</code></pre> </div> </template> </Tabs>
curl -O https://dl.typesense.org/releases/{{ $site.themeConfig.typesenseLatestVersion }}/typesense-server-{{ $site.themeConfig.typesenseLatestVersion }}-darwin-amd64.tar.gz tar -xzf typesense-server-{{ $site.themeConfig.typesenseLatestVersion }}-darwin-amd64.tar.gz
mv ./typesense-server $PATH_TO_EXISTING_BINARY
kill <TYPESENSE_PROCESS_ID> # will gracefully shutdown
export TYPESENSE_API_KEY=xyz ./typesense-server --data-dir="$(pwd)"/typesense-data --api-key=$TYPESENSE_API_KEY --enable-cors</code></pre> </div> </template> </Tabs>