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

# Connect to an existing database

> Connect the ABBYY FlexiCapture Application Server to an existing SQL Server, Oracle, Azure, or PostgreSQL database from the Console, and then upgrade the schema.

Instead of [creating a new database](/flexi-capture/admin-guide/create-database), the administrator may need to connect to an existing database (for example, if the connection settings have been changed).

<Note>
  For databases created in earlier versions of ABBYY FlexiCapture, see [Update databases and projects created in ABBYY FlexiCapture Distributed](/flexi-capture/admin-guide/renew-database-and-projects).
</Note>

* In ABBYY FlexiCapture Release 4 Update 2, PostgreSQL is enabled by default. To be able to work with PostgreSQL databases in earlier versions of ABBYY FlexiCapture, you will need to [enable PostgreSQL](/flexi-capture/postgres-sql-enable) first.
* In the case of a PostgreSQL database, the `fc` schema and all its objects must be owned by the user account that the Application Server uses to work with the database.

To connect to an existing database:

<Steps>
  <Step title="Open the Application Server settings">
    On the computer where the Application Server is installed, open the Administration and Monitoring Console under the Windows administrator account and click **Settings → Application Server** to open the page `https://<ApplicationServer>/FlexiCapture12/Monitoring/#Settings/DbConn` (where `<ApplicationServer>` is the name of the computer on which the Application Server is installed).

    If the Application Server is already connected to a database, start at step 4.
  </Step>

  <Step title="Start a new connection">
    Click **Connect to Existing Database**.
  </Step>

  <Step title="Enter the connection details">
    In the form that opens, complete the following fields: the name of the Microsoft SQL Server, Oracle, Azure, or PostgreSQL instance; the name of the existing database (for Oracle, Azure, or PostgreSQL); the user that administers the database server; and the path to the file storage (if any).
  </Step>

  <Step title="Test the connection">
    Use the **Test Connection** button to check the entered values. If the test is successful, click **OK**.
  </Step>

  <Step title="Upgrade the database if prompted">
    Your server is now connected to the database. If an **Upgrade** link is displayed on the **Settings → Application Server** page next to the database version, upgrade the database before you proceed (see [Upgrade a database](#upgrade-a-database)).
  </Step>

  <Step title="Note the temporary password">
    If ABBYY FlexiCapture authentication has never been used for this database, the user under whose account the Administration and Monitoring Console is running is issued the temporary password `password`.
  </Step>
</Steps>

## Upgrade a database

When upgrading a database, you may need to change its structure. To change the database structure, use the script provided with the upgrade. To execute the script, click **Apply Upgrade** and provide the path to the script.
