---
title: Updating a collector manually
slug: how-tos/LEQk-up
createdAt: 2025-09-04T15:07:37.455Z
---

This page describes how to **manually update a collector**. For a more automated approach, see [Updating a collector automatically](docId\:g3adOd9UPOm4AlSlqULWR).

## Important upgrade notes

Manually updating a collector follows the same steps as [Installing a collector](docId\:Iv4_SD56TdxcqKRKCj4kv).

Generating a new API token will invalidate the current token **after 24 hours**. During this period, the collector will continue to send data. If you still have the existing token available, **you do not need to generate a new token** to upgrade the collector.

When upgrading from a collector version that does **not** support advanced settings in the historian, you must first [recover the environment variables](docId\:LEQkpXddJqEnEPMncv45c) before upgrading. During the upgrade process, the environment is overwritten.

:::hint{type="warning"}
Before upgrading, always review the release notes of all collector versions between your current version and the target version for any breaking changes.
:::

## Recovering environment variables before upgrade

### Linux

Environment variables are stored in the environment file:

:::BlockQuote
/etc/systemd/system/environments/factry-collector-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
:::

Replace the `x` values with the collector ID (available in the historian).

### Windows

1. Open **Registry Editor**.
2. Navigate to
   `Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services`
3. Select `factry-collector-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`
4. Right-click **Environment** and select **Modify…**
5. Note all environment variables **except**:
   - `API_TOKEN`
   - `SERVICE_NAME`
   - `WORKING_DIRECTORY`

## Configuration

After installation, the collector automatically registers itself with the historian.
The collector configuration will then be available in the historian UI.

## Switching to a new collector service

To switch a collector instance in the historian to a new collector service:

1. Generate a new API token
2. Install a new collector service using this token
3. Remove the old (inactive) collector service from the system

### Using a new server

You can move a collector to a different server.
Ensure that all required TCP ports from the Historian server are reachable from the new collector host.

## Expected outcome

After a successful upgrade:

- The collector runs the new version
- The collector reconnects to Factry Historian
- The collector appears online and resumes sending data
- Existing measurements and configuration remain available

## Troubleshooting

### Collector does not come online after upgrade

**Possible causes:**

- Incorrect API URL configured in the historian
- Network connectivity issues between the collector host and the historian

Verify the API URL under **Configuration > General > API > URL**, confirm network access, and check that required settings were restored before upgrading.
