Migrate event timestamp

i have some sample data in mysql.
want to migrate old data in mysql to event store.

but in old data, i have own timestamp already.
so if i insert old data to event store, it can’t be saved well.
i want to keep old data’s timestamp without adding column.

how to set the timestamp when i migrate?

Hi @imnewone,

Which timestamp are you talking about?
Is it from the event itself (the MetaData field) or an internal field of your event?

Also, can you maybe insert some ideas and examples of what you have at the moment and what you want to achieve? Some events would be nice!


@lfgcampos thank you to quick reply!

this is my old data schema.

id: String
createdAt: LocalDateTime
stuff: String

below code is sample event.

id: String
stuff: String

so if i call command handler, event store make timestamp when event is inserted.

i make migrate code.

  1. read whole old data and make order by date(createdAt)
  2. call controller so it can call commandhandler.
  3. than the old data inserted event store (domainevents table)
    => old data is inserted with new timestamp!
    => this make me trouble. because i want to insert timestamp that old data have (createdAt). not new one.