Guides / Sending and managing data / Manage indices and apps / Manage indices

If you want to rename indices, you can move them using the Algolia dashboard or the API. Moving an index doesn’t move the associated analytics data. You can only rename primary indices.

Renaming replica indices requires several steps.

Moving or renaming an index is resource-intensive and is rate-limited.

Rename indices in the Algolia dashboard

  1. Go to the Algolia dashboard and select your Algolia application.
  2. On the left sidebar, select Algolia Search Search.
  3. Select your Algolia index:

    Select your Algolia application and index

  4. Select Manage index > Rename.

    Rename or move an index from the Algolia dashboard.

    The Rename option only shows if you selected a primary index. It doesn’t show for replica indices.

  5. 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 the API

To rename or move an index with the API, use one of these methods:

To move an index between different Algolia applications, see Copy indices between apps.

1
2
3
4
5
6
7
8
9
10
11
<?php
require_once __DIR__."/vendor/autoload.php";
use Algolia\AlgoliaSearch\SearchClient;

// Use an API key with `addObject` ACL
$client = SearchClient::create(
  'YourApplicationID', 'YourAPIKey'
);

// Rename `indexNameSrc` to `indexNameDest` (and overwrite it)
$index = $client->moveIndex('indexNameSrc', 'indexNameDest');

If an index with the new name already exists, move overwrites it. If you want to avoid overwriting existing indices, you can check if an index exists with the indexExists method.

If the source index doesn’t exist, Algolia ignores the move operation.

Renaming an index doesn’t change the associated analytics:

  • Analytics belonging to the original index keep their name.
  • A new set of analytics is started with the new name.

See Indices and analytics for more information.

Indices with replicas

You can’t move a source index with replicas. It would break the relationship between the index and its 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.

Moving 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 so, you’ll lose the relationship between the recommended records and their source.

Instead:

  1. Copy the index.
  2. To keep the events you already collected, train a new model on the copy index using the old index as an additional events source.
  3. After training, switch your own apps and services to use the new index.
  4. Delete the old index and the old model (from the Algolia dashboard).
Did you find this page helpful?