Export and re import templates

if i do not care about my old data, is there any way to export an index template with dynamic fields and put it back after some changes into elasticsearch?

this blog post helped to solve : https://www.elastic.co/blog/logstash_lesson_elasticsearch_mapping