Copy index from one application to another giving exception

I wanted to copy index from one application to another since we have got a new application to be used. I have around 50K products data in an index that I am trying to copy.

  1. Using API:
    I tried using copyIndex but that gave exception after 2K products only
  2. Using CLI
    I tried to use the CLI but it is not taking the parameters. I tried using this command:
    algolia --profile objects browse | algolia --profile objects import _ --file -

This command is giving the error “algolia objects import” requires exactly one argument.
Any help here will be highly appreciated.

Hi @tina.oswal

Are you supplying a profile name along with the profile setting? I’m also not sure about the underscore.

The canonical example in the documentation for the CLI is:
algolia objects browse <index1> -p <profile1> \ | algolia objects import <index2> -p <profile2> -F -

Hi @chuck.meyer,
I did check for algolia objects import in the documentation and then found that at the end i just need to have -F-
I made this change and it worked. Thank you.

However, I am still curious on why the API copyIndex was giving exception? DO we need to consider batching, etc?

1 Like

Hi @tina.oswal

Yes, when copying between Apps, you need to hit the public API endpoint (if copying within an application, we can do the copy internally).

This means you are subject to rate limiting:

Copying an index is expensive and is rate-limited:

  • If you have more than 100 pending requests, the engine throttles your requests.
  • If you have more than 5,000 pending requests, further requests are ignored.

This helps. Thank you.

1 Like