AzureCosmosDB / data-migration-desktop-tool

MIT License
122 stars 46 forks source link

_ts property is being set to local time despite using IncludeMetadataFields flag #139

Open JohnDStrasz opened 1 month ago

JohnDStrasz commented 1 month ago

We have an issue whereby the _ts timestamp field is not being restored from the source in the destination. The _ts property is being populated with the latest epoch time.

We're copying from our Cosmos account in the cloud to our local Emulator for local development needs.

The migrationsettings file is below and we are using the IncludeMetadataFields flag on both the export and import (not sure if it's needed on both). For certain business purposes, we would like the _ts to be preserved.

Is there a way to achieve what we need?

{ "Source": "cosmos-nosql", "SourceSettings": { "Query": "SELECT * FROM c", "IncludeMetadataFields": true }, "Destination": "cosmos-nosql", "DestinationSettings": { "WriteMode": "Upsert", "IncludeMetadataFields": true }, "Operations": [ { "SourceSettings": { "ConnectionString": "AccountEndpoint=xxx", "Database": "xxx-dev", "Container": "MyContainer" }, "DestinationSettings": { "ConnectionString": "xxx", "Database": "xxx-local", "Container": "MyContainer", "PartitionKeyPath": "/myPartitionKey" } } ] }