# Migrating scripted fields

**URL:** <https://discuss.elastic.co/t/migrating-scripted-fields/150650>\
**Category:** Kibana\
**Created:** [October 2, 2018, 6:29am UTC](https://discuss.elastic.co/t/migrating-scripted-fields/150650 "2018-10-02T06:29:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kumpelblase](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kumpelblase/32/35709_2.png) [@kumpelblase](https://discuss.elastic.co/u/kumpelblase)\
**Post date:** [October 2, 2018, 6:29am UTC](https://discuss.elastic.co/t/migrating-scripted-fields/150650/1 "2018-10-02T06:29:48Z")

</div>

Hi there  
I have some scripted fields in an instance of elasticsearch with version 6.0.0. I want them now in my elasticsearch 6.4.0. When I just take and copy them don't work anymore. The scripts all deal with dates. Here's one for example: `def x= doc['CreationDate'].date.dayOfWeek; return x;`  
One thing to note: in version 6.0.0, the 'CreationDate' field was a date field of `dd.mm.yyyy` format. Now in version 6.4.0 the 'CreationDate' field is a date field of `dd.mm.yyyy HH:mm:ss`.  
Is there a way to get this scripted field working again?

---

<div class="post-metadata">

**Author:** ![kumpelblase](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kumpelblase/32/35709_2.png) [@kumpelblase](https://discuss.elastic.co/u/kumpelblase)\
**Post date:** [October 2, 2018, 8:38am UTC](https://discuss.elastic.co/t/migrating-scripted-fields/150650/2 "2018-10-02T08:38:23Z")

</div>

I restarted ES, now the fields work.

---

<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:** [October 30, 2018, 8:51am UTC](https://discuss.elastic.co/t/migrating-scripted-fields/150650/3 "2018-10-30T08:51:04Z")

</div>

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