# Manually copying an index?

**URL:** https://discuss.elastic.co/t/manually-copying-an-index/4597
**Category:** Elasticsearch
**Created:** [June 10, 2011, 9:54am UTC](https://discuss.elastic.co/t/manually-copying-an-index/4597 "2011-06-10T09:54:45Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![maho](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@maho](https://discuss.elastic.co/u/maho)
#### Post date: [June 10, 2011, 9:54am UTC](https://discuss.elastic.co/t/manually-copying-an-index/4597/1 "2011-06-10T09:54:45Z")

</div>

Hi,

is it possible create a new index an copying the index data from the  
index folder in the filesystem of index a to index b?

Thanks.

---

<div class="post-metadata">

### Author: ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)
#### Post date: [June 10, 2011, 12:03pm UTC](https://discuss.elastic.co/t/manually-copying-an-index/4597/2 "2011-06-10T12:03:21Z")

</div>

On Fri, 2011-06-10 at 02:54 -0700, maho wrote:

> Hi,
> 
> is it possible create a new index an copying the index data from the  
> index folder in the filesystem of index a to index b?

It is, but you'd need to script it yourself.

See for instance:

[http://blogs.perl.org/users/clinton\_gormley/2011/04/elasticsearchpm-v036-now-with-extra-sugar.html](http://blogs.perl.org/users/clinton_gormley/2011/04/elasticsearchpm-v036-now-with-extra-sugar.html)

clint

---

<div class="post-metadata">

### Author: ![maho](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@maho](https://discuss.elastic.co/u/maho)
#### Post date: [June 10, 2011, 12:09pm UTC](https://discuss.elastic.co/t/manually-copying-an-index/4597/3 "2011-06-10T12:09:18Z")

</div>

Thanks for your answer.

Isn't it possible to copy the index in the filesystem because that  
will be much faster.

On 10 Jun., 14:03, Clinton Gormley [clin...@iannounce.co.uk](mailto:clin...@iannounce.co.uk) wrote:

> On Fri, 2011-06-10 at 02:54 -0700, maho wrote:
> 
> > Hi,
> 
> > is it possible create a new index an copying the index data from the  
> > index folder in the filesystem of index a to index b?
> 
> It is, but you'd need to script it yourself.
> 
> See for instance:
> 
> [http://blogs.perl.org/users/clinton\_gormley/2011/04/elasticsearchpm-v](http://blogs.perl.org/users/clinton_gormley/2011/04/elasticsearchpm-v)...
> 
> clint

---

<div class="post-metadata">

### Author: ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)
#### Post date: [June 10, 2011, 12:12pm UTC](https://discuss.elastic.co/t/manually-copying-an-index/4597/4 "2011-06-10T12:12:42Z")

</div>

On Fri, 2011-06-10 at 05:09 -0700, maho wrote:

> Thanks for your answer.
> 
> Isn't it possible to copy the index in the filesystem because that  
> will be much faster.

I don't think so. You used to be able to do that. It required an update  
to the mappings file with a text editor, but that file is no longer  
text.

clint

---

<div class="post-metadata">

### Author: ![maho](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@maho](https://discuss.elastic.co/u/maho)
#### Post date: [June 10, 2011, 12:21pm UTC](https://discuss.elastic.co/t/manually-copying-an-index/4597/5 "2011-06-10T12:21:03Z")

</div>

Do I also update the mapping file if i want to use the exact same  
mapping configuration in the new index?

Or is there stored something like the core name or path to index?

On 10 Jun., 14:12, Clinton Gormley [clin...@iannounce.co.uk](mailto:clin...@iannounce.co.uk) wrote:

> On Fri, 2011-06-10 at 05:09 -0700, maho wrote:
> 
> > Thanks for your answer.
> 
> > Isn't it possible to copy the index in the filesystem because that  
> > will be much faster.
> 
> I don't think so. You used to be able to do that. It required an update  
> to the mappings file with a text editor, but that file is no longer  
> text.
> 
> clint

---

<div class="post-metadata">

### Author: ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)
#### Post date: [June 10, 2011, 12:35pm UTC](https://discuss.elastic.co/t/manually-copying-an-index/4597/6 "2011-06-10T12:35:57Z")

</div>

On Fri, 2011-06-10 at 05:21 -0700, maho wrote:

> Do I also update the mapping file if i want to use the exact same  
> mapping configuration in the new index?
> 
> Or is there stored something like the core name or path to index?

Perhaps I haven't understood what you are trying to achieve. Are you  
trying to create a new index as a copy of the old index so that you have  
old\_index and new\_index, or are you trying to move your data from one  
location in the file system to another?

If the latter, then you can just move the data directory and point to  
the new location:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

If the former, then you're going to have to use the API to copy the  
index

clint

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 4:03am UTC](https://discuss.elastic.co/t/manually-copying-an-index/4597/7 "2017-07-06T04:03:53Z")

</div>


