[okfn-labs] ElasticSearch backup/restore
nick at whiteink.com
Mon Apr 16 14:43:33 BST 2012
Maybe I cocked something up when I did it, but I definitely tried that and
it failed to work. Will investigate...
On 16 Apr 2012, at 14:41, Mark MacGillivray <mark.macgillivray at okfn.org>
(and resending again - sent from wrong address, got bounced)
I thought it was possible to just copy the data files directly out of the
ES data folder, then go to your alternate, create the database and POST the
mappings, then dump the data files you copied in place of the empty ones
that were just created on your alternate. (It has been a while since I did
this and maybe does not work any more or is harder, but I am certain I have
done it in the past).
On Mon, Apr 16, 2012 at 2:29 PM, Nick Stenning <nick at whiteink.com> wrote:
> Dear all,
> As part of work on AnnotateIt, I've had a need to copy data from
> ElasticSearch between different indices (for example, copying data
> from the production to the staging index, in order to do proper
> acceptance testing on what was once live data).
> It's actually a little tricky to do this in a nice way (or so I
> found), but I've now got a workable solution which I thought might be
> useful for some of you. It's committed to the sysadmin repo:
> And you use it thusly:
> backup-es.sh localhost:9200 index_name
> Which will generate a mappings file, and a line-delimited file with
> all your documents in. You can then:
> restore-es.sh localhost:9200 another_index_name mappings.json
> It's not fast or clever, but I hope some of you find this useful
> okfn-labs mailing list
> okfn-labs at lists.okfn.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the okfn-labs