# Moving data from AWS elasticsearch to elastic.co

**URL:** https://discuss.elastic.co/t/moving-data-from-aws-elasticsearch-to-elastic-co/131650
**Category:** Elasticsearch
**Created:** [May 14, 2018, 1:55am UTC](https://discuss.elastic.co/t/moving-data-from-aws-elasticsearch-to-elastic-co/131650 "2018-05-14T01:55:09Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![vadiraj\_bidarahalli](https://avatars.discourse-cdn.com/v4/letter/v/7ea924/32.png) [@vadiraj\_bidarahalli](https://discuss.elastic.co/u/vadiraj_bidarahalli)
#### Post date: [May 14, 2018, 1:55am UTC](https://discuss.elastic.co/t/moving-data-from-aws-elasticsearch-to-elastic-co/131650/1 "2018-05-14T01:55:10Z")

</div>

Currently we are running elasticsearch 5.5 on AWS elasticsearch.. We want to move to [elastic.co](http://elastic.co).

The size of the data was around 28 GB. We deleted around 6600 K docs using delete by query.  
But the size remained the same at 28GB. So no point in taking backup and restoring in new index on [elastic.co](http://elastic.co) since the backup would bring along with it the junk documents.

So we are planning to do a reindex.

Can i separately do \_reindex type by type like below...

```
POST _reindex
{
  "source": {
    "index": "oldindex",
    "type": "oldtype1"
  },
  "dest": {
    "index": "new_index"
  }
}
 
 
and then
 
 
POST _reindex
{
  "source": {
    "index": "oldindex",
    "type": "oldtype2"
  },
  "dest": {
    "index": "new_index"
  }
}

```

or do i have to specify type in dest also?

Regards  
Vadiraj

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [May 14, 2018, 5:21am UTC](https://discuss.elastic.co/t/moving-data-from-aws-elasticsearch-to-elastic-co/131650/2 "2018-05-14T05:21:06Z")

</div>

> [@vadiraj\_bidarahalli](#):
>
> We deleted around 6600 K docs using delete by query.
> 
> But the size remained the same at 28GB

Did you run a force merge to flush them out?

---

<div class="post-metadata">

### Author: ![vadiraj\_bidarahalli](https://avatars.discourse-cdn.com/v4/letter/v/7ea924/32.png) [@vadiraj\_bidarahalli](https://discuss.elastic.co/u/vadiraj_bidarahalli)
#### Post date: [May 14, 2018, 3:12pm UTC](https://discuss.elastic.co/t/moving-data-from-aws-elasticsearch-to-elastic-co/131650/3 "2018-05-14T15:12:12Z")

</div>

I read that forcemerge is not recommended on active node... in fact, we should allow elasticsearch to naturally remove them is what I read somewhere... so, I thought of reindexing...

does my reindexing method work? type by type

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [May 14, 2018, 3:34pm UTC](https://discuss.elastic.co/t/moving-data-from-aws-elasticsearch-to-elastic-co/131650/4 "2018-05-14T15:34:18Z")

</div>

> [@vadiraj\_bidarahalli](#):
>
> I read that forcemerge is not recommended on active node

On an active index, yes.

> [@vadiraj\_bidarahalli](#):
>
> does my reindexing method work? type by type

Yes.

---

<div class="post-metadata">

### Author: ![Johnnycc1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johnnycc1/32/26069_2.png) [@Johnnycc1](https://discuss.elastic.co/u/Johnnycc1)
#### Post date: [May 14, 2018, 11:52pm UTC](https://discuss.elastic.co/t/moving-data-from-aws-elasticsearch-to-elastic-co/131650/5 "2018-05-14T23:52:54Z")

</div>

The deleted documents should

> [@vadiraj\_bidarahalli](#):
>
> I read that forcemerge is not recommended on active node

Depends what you mean by active node. If you create new indices each month / day - and old indices are no longer updated or added to then forcemerging is fine. Noting it can take a long time.

Alternatively if you have active indexes deleted documents should be removed automagically by elastic as new documents are indexed over time (force merging is not recommended for these indices).

---

<div class="post-metadata">

### Author: ![vadiraj\_bidarahalli](https://avatars.discourse-cdn.com/v4/letter/v/7ea924/32.png) [@vadiraj\_bidarahalli](https://discuss.elastic.co/u/vadiraj_bidarahalli)
#### Post date: [May 15, 2018, 1:47am UTC](https://discuss.elastic.co/t/moving-data-from-aws-elasticsearch-to-elastic-co/131650/6 "2018-05-15T01:47:43Z")

</div>

thank you

---

<div class="post-metadata">

### Author: ![vadiraj\_bidarahalli](https://avatars.discourse-cdn.com/v4/letter/v/7ea924/32.png) [@vadiraj\_bidarahalli](https://discuss.elastic.co/u/vadiraj_bidarahalli)
#### Post date: [May 15, 2018, 6:46am UTC](https://discuss.elastic.co/t/moving-data-from-aws-elasticsearch-to-elastic-co/131650/7 "2018-05-15T06:46:49Z")

</div>

One more question.. can my application be running and the source elasticsearch domain in use, while reindexing is going on? Will it affect reindexing process or source data if any requests came in during reindexing?

---

<div class="post-metadata">

### Author: ![Johnnycc1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johnnycc1/32/26069_2.png) [@Johnnycc1](https://discuss.elastic.co/u/Johnnycc1)
#### Post date: [May 18, 2018, 11:51pm UTC](https://discuss.elastic.co/t/moving-data-from-aws-elasticsearch-to-elastic-co/131650/8 "2018-05-18T23:51:50Z")

</div>

Yes you can continue using the existing index when reindexing it into another index. If you read the reindexing documentation it says it takes a snapshot of the existing index when you kick off the reindexing. So what that means is changes made after you start the reindexing will not be brought across.

What you can do is pull all of the current documents across. Then perform another quick reindexing with a query that just targets the changes since the first run - when you are ready to migrate.

---

<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: [June 15, 2018, 11:51pm UTC](https://discuss.elastic.co/t/moving-data-from-aws-elasticsearch-to-elastic-co/131650/9 "2018-06-15T23:51:52Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
