How to copy indices between two accounts?

Need Java API to copy indices between two accounts.

//Sync version

Index myIndex = client.initIndex("MyIndex");

// Copy MyIndex in MyIndexCopy
myIndex.copyTo("MyIndexCopy");
//Async version
AsyncIndex myIndex = client.initIndex("MyIndex");

// Copy MyIndex in MyIndexCopy
myIndex.copyTo("MyIndexCopy");

That would copy an index to a new index within the account. But, I need to copy to a different Algolia account.

Is this something you do once or multiple times?

So, this is part of our restore and the backup plan. The goal is to take timely backups of the indices and restore in case of rollback scenarios. While restore and backup is confined to a single account, we are migrating the existing indices to a new account for one time because of the plan limitations.

Since this is a one-time thing, you can browse the complete index, get the settings, synonyms and query rules, and add all of that to the second account. That’s what we do internally too in cases like that.

Can you point me to the code or doc?

myIndex.getSettings(), setSettings, https://www.algolia.com/doc/api-reference/api-methods/browse/

Does that help?

I can import settings with this method, how do I import data from a file via Java API?

you read the file, parse it as objects and do addObject