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. See Rename replica indices for more information.

Moving or renaming an index is an expensive operation and is rate-limited.

Rename indices from the Algolia dashboard

To rename or move an index in the dashboard:

  1. Go to the Algolia dashboard and select your index from the Index menu.

  2. 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.

  3. Enter the current and new index names and click Rename.

    Confirm by entering the current index name and provide a new name.

If an index with the new name already exists, it’s overwritten.

Rename indices using the API

To rename or move an index, use the moveIndex method with an API client, or use the algolia indices move command with the Algolia CLI. To move an index between different Algolia applications, see Copy indices between apps.

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. To prevent accidentally overwriting existing indices, you can check if an index exists with the indexExists method.

If the source index doesn’t exist, the move operation is ignored.

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.

Moving indices with replicas

You can’t move a source index with replicas, as it would break the relationship between the index and its replicas. You can move an index to a destination index with replicas. During the process, the data from the destination index is replaced with the data from the source index. Then, the data is copied to the replicas.

Did you find this page helpful?