You can use the Reindex API to migrate indices from the old 2.x Elasticsearch cluster to a new 6.x Elasticsearch cluster.
For more information, see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#reindex-from-remote.