# Schema Migrations

**URL:** <https://discuss.elastic.co/t/schema-migrations/81108>\
**Category:** Elasticsearch\
**Created:** [April 4, 2017, 9:32am UTC](https://discuss.elastic.co/t/schema-migrations/81108 "2017-04-04T09:32:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sodiaan](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@sodiaan](https://discuss.elastic.co/u/sodiaan)\
**Post date:** [April 4, 2017, 9:32am UTC](https://discuss.elastic.co/t/schema-migrations/81108/1 "2017-04-04T09:32:39Z")

</div>

When we write an application, we also write migrations for database schema and data, we use [liquibase](http://www.liquibase.org/) for that.

What tools/library are using for migrations ElasticSearch schema?

---

<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:** [April 4, 2017, 9:34am UTC](https://discuss.elastic.co/t/schema-migrations/81108/2 "2017-04-04T09:34:19Z")

</div>

Migrations in what sense?

---

<div class="post-metadata">

**Author:** ![sodiaan](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@sodiaan](https://discuss.elastic.co/u/sodiaan)\
**Post date:** [April 4, 2017, 9:40am UTC](https://discuss.elastic.co/t/schema-migrations/81108/3 "2017-04-04T09:40:18Z")

</div>

When I deploy an application on new server, everytime I must execute this query before application starts  
curl -XPUT 'localhost:9200/products?pretty' -H 'Content-Type: application/json' -d'  
{  
"mappings": {  
"doctype": {  
"properties": {  
"title": {  
"type": "text"  
}  
}  
},  
"queries": {  
"properties": {  
"query": {  
"type": "percolator"  
}  
}  
}  
}  
}'

So, i am asking is there a tool where I can put this schema and run this schema if application is first time running

---

<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:** [April 4, 2017, 9:41am UTC](https://discuss.elastic.co/t/schema-migrations/81108/4 "2017-04-04T09:41:30Z")

</div>

Are you saying you are deploying to a new cluster? Or the same one?

Also we call schema's mappings 🙂

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 4, 2017, 9:44am UTC](https://discuss.elastic.co/t/schema-migrations/81108/5 "2017-04-04T09:44:25Z")

</div>

Which language are you using to develop your application?

---

<div class="post-metadata">

**Author:** ![sodiaan](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@sodiaan](https://discuss.elastic.co/u/sodiaan)\
**Post date:** [April 4, 2017, 9:46am UTC](https://discuss.elastic.co/t/schema-migrations/81108/6 "2017-04-04T09:46:05Z")

</div>

For example I am deploying an application locally as developer on my machine, application uses elasticsearch, but before adding some data I need to execute that query  
So, I want to add that query to some files, so, when another developer will deploy application on his machine, that query will be executed automatilly

---

<div class="post-metadata">

**Author:** ![sodiaan](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@sodiaan](https://discuss.elastic.co/u/sodiaan)\
**Post date:** [April 4, 2017, 9:46am UTC](https://discuss.elastic.co/t/schema-migrations/81108/7 "2017-04-04T09:46:40Z")

</div>

Java

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 4, 2017, 9:58am UTC](https://discuss.elastic.co/t/schema-migrations/81108/8 "2017-04-04T09:58:41Z")

</div>

Have a look at: [https://github.com/dadoonet/elasticsearch-beyonder](https://github.com/dadoonet/elasticsearch-beyonder)

---

<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:** [May 2, 2017, 9:58am UTC](https://discuss.elastic.co/t/schema-migrations/81108/9 "2017-05-02T09:58:41Z")

</div>

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