> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit a Data Source

> Update an existing Data Source - change credentials, switch the host, or adjust SSL settings without recreating the connection.

Use this page to update an existing editable Data Source when its database access details change.

## Objective

***

Keep a Data Source usable without deleting and recreating it.

For example, edit a Data Source when an external database password rotates, the host changes after an infrastructure migration, a new schema must be visible, or SSL settings are updated.

## When to use

***

Use this task when:

* credentials changed;
* host, port, or database name changed;
* schema access changed;
* SSL mode or CA certificate changed;
* metadata needs better operator context.

If the Data Source was automatically configured for an internal Lerian product, confirm whether it is meant to be edited from the Console before changing it.

If the connection is retired and should no longer be used, delete it instead.

## Before you start

***

Confirm what changed:

* credentials: update **Username** or **Password**;
* database location: update **Host**, **Port**, or **Database Name**;
* schema visibility: update the schema list;
* security: update **SSL Mode** or **CA Certificate**.

<Note>
  A Data Source update affects future Report generation. Reports already generated stay unchanged.
</Note>

## Step by step

***

<Steps>
  <Step title="Open Data Sources">
    Go to **Data Sources**.
  </Step>

  <Step title="Find the connection">
    Locate the card for the Data Source you need to edit.
  </Step>

  <Step title="Open the edit form">
    Click the three vertical dots (<Icon icon="ellipsis-vertical" />) on the card and select **Edit**.
  </Step>

  <Step title="Update the fields">
    In **Edit Connection**, change the fields that need correction.
  </Step>

  <Step title="Save changes">
    Click **Save Changes**.
  </Step>

  <Step title="Test the connection">
    Run **Test Connection** to confirm the updated settings work.
  </Step>
</Steps>

<Note>
  The **Password** field appears empty for security reasons. Enter a new value only when changing the password. Leaving it blank keeps the current password.
</Note>

## Field guide

***

| Field                         | What to change                                                                                           | Example                          |
| ----------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------- |
| **Connection Name**           | Required operator-facing name. Technical field: `configName`; Console validation is 3 to 100 characters. | `production-postgres-readonly`   |
| **Database Type**             | Database engine used by the connection. Console currently offers `POSTGRESQL` and `MONGODB`.             | `POSTGRESQL`                     |
| **Host**                      | Database server address. Changing it changes where Reporter reads future data from.                      | `db-new.example.com`             |
| **Port**                      | Database network port. Valid range is 1 to 65535.                                                        | `5432`                           |
| **Database Name**             | Database Reporter queries through this Data Source.                                                      | `ledger_reporting`               |
| **Username**                  | Database user used by Reporter.                                                                          | `reporter_readonly`              |
| **Password (optional)**       | Leave blank to keep the current password. Enter a value only when replacing the stored credential.       | New rotated password             |
| **Schemas**                   | Optional schema list stored as `metadata.schemas`; entries are trimmed, lowercased, and deduplicated.    | `public`, `pix`                  |
| **Enable SSL**                | Toggle SSL settings. Disabling SSL sends `ssl.mode = disable`.                                           | Disabled after network migration |
| **SSL Mode**                  | SSL behavior. Use `disable`, `require`, `verify-ca`, or `verify-full`.                                   | `verify-full`                    |
| **CA Certificate**            | Required when changing SSL to `verify-ca` or `verify-full`. Leave blank unless replacing SSL material.   | PEM CA certificate               |
| **Metadata** key/value fields | Optional classification data. Only rows with a nonblank key are submitted.                               | `owner = compliance`             |

## Expected result

***

The Data Source keeps the updated configuration. After a successful test, operators can rely on it for Templates and Reports.

## Common errors and care points

***

<AccordionGroup>
  <Accordion title="Leaving password blank unintentionally">
    Leaving **Password** blank preserves the existing password. Enter a new value only when the credential changed.
  </Accordion>

  <Accordion title="Changing host without testing">
    Host and port changes can point Reporter to a different database. Always run **Test Connection** after saving.
  </Accordion>

  <Accordion title="Removing a schema that Templates use">
    If a Template or filter depends on fields from a schema, removing that schema can break future generation.
  </Accordion>

  <Accordion title="Editing when the connection should be retired">
    If the database is no longer used by any reporting process, delete the Data Source instead of editing it.
  </Accordion>
</AccordionGroup>

## Next steps

***

* Use [Test a Data Source Connection](/en/lerian-console/reporter-console/testing-a-data-source) after every connection change.
* Use [Generate a Report](/en/lerian-console/reporter-console/generating-a-report) only after the connection is healthy.
* Use [Delete a Data Source](/en/lerian-console/reporter-console/deleting-a-data-source) when the connection is retired.

<Card title="API equivalent" type="tip" horizontal>
  [Update connection endpoint](/en/reference/reporter/connections/update-connection)
</Card>
