# Reindexing data to elasticSearch cloud

**URL:** <https://discuss.elastic.co/t/reindexing-data-to-elasticsearch-cloud/212397>\
**Category:** Elasticsearch\
**Created:** [December 18, 2019, 8:02pm UTC](https://discuss.elastic.co/t/reindexing-data-to-elasticsearch-cloud/212397 "2019-12-18T20:02:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ilyoskhuja](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ilyoskhuja/32/47524_2.png) [@Ilyoskhuja](https://discuss.elastic.co/u/Ilyoskhuja)\
**Post date:** [December 18, 2019, 8:02pm UTC](https://discuss.elastic.co/t/reindexing-data-to-elasticsearch-cloud/212397/1 "2019-12-18T20:02:48Z")

</div>

Continuing the discussion from [Cloud elastic account,Reindex docs](https://discuss.elastic.co/t/cloud-elastic-account-reindex-docs/194177/9):  
until now I used elasticsearch cloud version below 7.5, and now when i tried reindex my data to Elasticsearch cloud with same code it didn't reindex, even didn't create index. My backend [asp.net](http://asp.net) core and i use NEST 7.4.2, here is my code:

> ```
> public static void AddElasticsearch(
> this IServiceCollection services, IConfiguration configuration)
> {
> var url = configuration["https://f3bf62---------------------68a99a39.europe-west1.gcp.cloud.es.io:9243"];
> var defaultIndex ="honadonz12";
>        
> var list = new List<string>();
> var settings = new ConnectionSettings(
> 
> new Uri("https://f3bf62--------------------68a99a39.europe-west1.gcp.cloud.es.io:9243"))
> .DefaultIndex(defaultIndex)
>          
> .BasicAuthentication("elastic", "Ghil-------------ELVBbwwG")
> 
>             
>               
> .DisableDirectStreaming() 
> .OnRequestCompleted(apiCallDetails => 
> {
> // log out the request and the request body, if one exists for the type of request
> if (apiCallDetails.RequestBodyInBytes != null)
> {
> list.Add(
> $"{apiCallDetails.HttpMethod} {apiCallDetails.Uri} " +
> $"{Encoding.UTF8.GetString(apiCallDetails.RequestBodyInBytes)}");
> }
> else
> {
> list.Add($"{apiCallDetails.HttpMethod} {apiCallDetails.Uri}");
> }
> 
> // log out the response and the response body, if one exists for the type of response
> if (apiCallDetails.ResponseBodyInBytes != null)
> {
> list.Add($"Status: {apiCallDetails.HttpStatusCode}" +
> $"{Encoding.UTF8.GetString(apiCallDetails.ResponseBodyInBytes)}");
> }
> else
> {
> list.Add($"Status: {apiCallDetails.HttpStatusCode}");
> }
> });
> 
> AddDefaultMappings(settings);
> 
> var client = new ElasticClient(settings);
> 
> services.AddSingleton<IElasticClient>(client);
> 
> CreateIndex(client, defaultIndex);
> }
> 
> private static void AddDefaultMappings(ConnectionSettings settings)
> {
> settings
> .DefaultMappingFor<ElasticSearchModel>(m => m);
>                
> }
> 
> private static void CreateIndex(IElasticClient client, string indexName)
> {
> if (!client.Indices.Exists(indexName).Exists)
> {
> var createIndexResponse = client.Indices.Create(indexName, c => c
> .Map<ElasticSearchModel>(mm => mm
> .AutoMap()
> )
> .RequestConfiguration(r => r
> .DisableDirectStreaming()
> )
> );
> 
> Console.WriteLine("Writeline is :" + createIndexResponse);}
> }
> }
> 
> ```

Error: Writeline is :Invalid NEST response built from a unsuccessful () low level call on PUT: /honadonz12

---

<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:** [January 15, 2020, 8:02pm UTC](https://discuss.elastic.co/t/reindexing-data-to-elasticsearch-cloud/212397/2 "2020-01-15T20:02:49Z")

</div>

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