Copying or moving an index is resource-intensive and
rate-limited.
Move or rename indices
You can move or rename an index within the same Algolia application in the Algolia dashboard or with an API client.Rename indices in the Algolia dashboard
- Go to the Algolia dashboard and select your Algolia application.
- On the left sidebar, select Search.
- Select your Algolia index.
-
Select Manage index > Rename.
The Rename option only shows if you selected a primary index. It doesn’t show for replica indices.
-
Enter the current and new index names and click Rename.
If an index with the new name already exists, it’s overwritten.
Rename indices with an API client
To rename or move an index with the API, you can use:- API clients:
operationIndex
- Algolia CLI:
algolia indices move
If an index with the new name already exists, moving overwrites it.
To avoid overwriting existing indices,
check if an index exists with
indexExists
.- Analytics associated with the original index keep their name.
- A new set of analytics is started with the new name.
Indices with replicas
Renaming replica indices requires several steps. You can’t move a source index with replicas. You can move an index to a destination index with replicas. First, the source index data replaces the destination index data. Then, the data is copied to the replicas.Indices used as a Recommend data source
If an index is the data source for Recommend models, you can’t rename it directly. If you do, you’ll lose the relationship between the recommended records and their source. Instead:- Copy the index.
- To keep the events you already collected, train a new model on the copy index using the old index as an additional events source.
- After training, switch your apps and services to use the new index.
- Delete the old index and the old model (from the Algolia dashboard).
Copy indices
You can copy an index in the Algolia dashboard or with an API client but be aware that:- Copying an index duplicates the records and configuration,
including synonyms and rules of an existing index (except the
enableReRanking
setting). - Copying an index doesn’t create a replica. The new index is an independent copy.
- To copy an index between two Algolia applications, you must use the API.
Copy indices in the Algolia dashboard
- Go to the Algolia dashboard and select your Algolia application.
- On the left sidebar, select Search.
- Select the Algolia index that you want to copy.
- Select Manage index > Duplicate.
- Select Create a new index or Overwrite an existing index and enter the destination index name.
- If you’re overwriting an existing index, enter
DUPLICATE
to confirm. - Click Duplicate.
Copy indices with an API client
To copy indices, you can use:- API clients:
operationIndex
- Algolia CLI:
algolia indices copy
scope
parameter to choose what you want to copy: records, settings, synonyms, or rules.
Copy indices fully
To copy an index including records, settings, synonyms, and rules:- If the source index doesn’t exist, an empty index is created.
- If an index with this name already exists, it will be overwritten.
To prevent overwriting existing indices,
check if an index exists with
indexExists
.Copy indices partially
To copy parts of an index, use thescope
parameter of the operationIndex
method.
For example, to copy only the synonyms and settings between indices, but not records or rules:
scope
parameter, records aren’t copied to the new index.
Existing items of the scope are replaced.
Items belonging to other scopes are preserved.
For example, if you use the settings
scope,
only the settings are copied to the destination index, keeping the records, synonyms, and rules.