# Migrate Collectors

### Objective

You have migrated resources from one Bindplane installation to another. All managed collectors need to be updated in order to connect to the new Bindplane server or project. The Bindplane servers can be onprem or Cloud.

### Prerequisites

The following requirements must be met:

* SSH (Linux) or Remote Desktop (Windows) access to the managed collectors
* Sudo or root access (Linux) or Administrator permissions (Windows)

### Procedure

1. Update Manager Configuration
2. Restart Collector
3. Validate

#### Update Manager Configuration

Edit the manager configuration with your editor of choice. On Linux, the path is `/opt/observiq-otel-collector/manager.yaml` and on Windows it is `C:/Program Files/observIQ OpenTelemetry Collector/manager.yaml`.

The configuration will look similar to this:

```yaml
endpoint: 'ws://192.168.1.9:3001/v1/opamp'
secret_key: '470b8fe1-8703-45f7-a76a-c15ec3ab8c48'
agent_id: 0193df6b-1086-7097-b8ab-76c5687d8bd5
labels: install_id=bd36a20e-5fab-4c9a-8a19-c77f99cbd03d
measurements_interval: 10s
extra_measurements_attributes:
  agent: 0193df6b-1086-7097-b8ab-76c5687d8bd5
  configuration: test
  interval: 10s
  version: v2
```

Modify the `endpoint` value to reflect the new IP address or hostname of the Bindplane server. Be sure to keep the protocol (`ws` / `wss`) and path (`/v1/opamp`) the same. If you are migrating between different Projects on the same Bindplane server, the endpoint will not change.

Modify the `secret_key`to match the secret key of the new Bindplane server or project. You can find your secret key on the collector install page by selecting "Install Collector".

All other fields should be deleted, as they will be populated on first connection to the new server or when a config from the new server is applied. The new configuration should look similar to this:

```yaml
endpoint: 'wss://app.bindplane.com:443/v1/opamp'
secret_key: '585f08db-6169-4b86-9cd0-38ff096fbf5e'
```

In the sample above, we have pointed to a new server, specifically our Cloud platform, that uses TLS (`wss://` instead of `ws://`), and the value of `secret_key` has changed due to being a new server. The `secret_key` would have been changed, even for a new project on the same server.

Once the manager configuration is updated, save the file and close your editor.

#### Restart Collector

Restart the collector after modifying the manager configuration.

On Linux:

```bash
sudo systemctl restart observiq-otel-collector
```

On Windows, use the "services" app or the following command:

```cmd
net stop "observIQ Distro for OpenTelemetry Collector"
net start "observIQ Distro for OpenTelemetry Collector"
```

#### Validate

Once the collector(s) are restarted, log into the Bindplane server's web interface. The collectors will now be connected to the new server or project.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bindplane.com/configuration/bindplane/migration/migrate-collectors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
