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

# Set up the PI replace utility

> Learn how to install and configure the Cognite PI replace utility to correct data loss and reconnection incidents in Cognite Data Fusion (CDF).

The Cognite PI replace utility is distributed with the Cognite PI extractor's Windows installer (.msi file). When you run the .msi file, a setup wizard guides you through the installation process.

## Before you start

The PI replace utility has the same server requirements and access capabilities as the PI extractor:

* Check the [server requirements](/cdf/integration/guides/extraction/pi/pi_server_requirements) for the PI extractor.
* Assign [access capabilities](/cdf/access/guides/capabilities#pi-replace-utility) in a CDF project.

<Tip>
  You can use OpenID Connect and your existing identity provider (IdP) framework to manage access to CDF data securely. [Read more](/cdf/integration/guides/extraction/admin_oidc).
</Tip>

## Run the PI replace utility

<Steps>
  <Step title="Download and locate the PI extractor">
    Navigate to **Data fusion** > **Integrate** > **Extractors** and download and run the latest PI extractor .msi. PI Replace is a part of the `PiExtractor.exe` application, run with the `replace` subcommand.

    For example, if the installation directory is `C:\Cognite\`, you can run Pi Replace as `C:\Cognite\PiExtractor\PiExtractor.exe replace`.
  </Step>

  <Step title="Create a working directory">
    Create a working directory.

    <Info>
      This shouldn't be the same as the installation directory.
    </Info>
  </Step>

  <Step title="Configure the utility">
    Create a `config` directory inside the working directory and create a configuration file according to the [configuration settings](/cdf/integration/guides/extraction/pi_replace/pi_replace_configuration). The file must be in YAML format.
  </Step>

  <Step title="Run the utility">
    Run `PiExtractor.exe replace` from the working directory.

    <Tip>
      You can override the default configuration directory with the `-f <config_file>` command line option.
    </Tip>
  </Step>
</Steps>

## Run periodically using Windows Task Scheduler

The PI replace utility is often required to run periodically, for instance, daily. You can set up Windows Task Scheduler according to [this procedure](/cdf/integration/guides/extraction/run_extractor_win_task_scheduler) for scheduled runs.
