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

# Copy index between applications

> Copies an index between Algolia applications.

This helper method copies an index from one Algolia application to another,
by performing these tasks:

1. Copy settings from the source index to the destination index.
2. Iterate through the paginated responses to retrieve all records, rules, and synonyms from the source index.
3. Copy the records, rules, and synonyms to the destination index.

For the source application, you need an API key with `browse` and `settings` ACL.
For the destination application, you need an API key with `addObject`, `settings`, and `editSettings` ACL.

## Usage

<CodeGroup>
  ```js JavaScript theme={"system"}
  const response = await client.accountCopyIndex({
    sourceIndexName: 'cts_e2e_account_copy_index_source_javascript',
    destinationAppID: 'test-app-id-destination',
    destinationApiKey: 'test-api-key-destination',
    destinationIndexName: 'cts_e2e_account_copy_index_destination_javascript',
    batchSize: 2,
  });
  ```
</CodeGroup>

## Parameters

<ParamField body="sourceIndexName" type="string" required>
  Name of the index from where to copy records, rules, settings, and synonyms.
</ParamField>

<ParamField body="destinationAppID" type="string" required>
  Algolia application ID of the destination index.
</ParamField>

<ParamField body="destinationApiKey" type="string" required>
  API key for the destination application.
</ParamField>

<ParamField body="destinationIndexName" type="string" required>
  Name of the index to which to copy records, rules, settings, and synonyms.
</ParamField>

<ParamField body="batchSize" type="int" default={1000}>
  Number of records to process in one batch.
</ParamField>
