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.
- Using API:
I tried using copyIndex but that gave exception after 2K products only
- 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.
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 -
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?
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.