Merge data split on different data directory

112 views
Skip to first unread message

Nunni

unread,
Jul 5, 2023, 8:56:22 AM7/5/23
to Prometheus Users
Hello.

Some weeks ago I have moved the prometheus working directory and now I realized that a new data dir was created and so I now have my data history split in two different folders, and prometheus at present only shows the data from the new data folder.

I tried to copy the missing folders (01xxxxx..xx) from the old data folder to the current but prometheus apparently is not aware the older data is now there, even after restarting prometheus.

Could anybody help me fix this, please?

Thank you and best regards.

Ben Kochie

unread,
Jul 5, 2023, 12:40:51 PM7/5/23
to Nunni, Prometheus Users
It should be no problem to combine the data from both directories. You will want to stop the server while you are doing this. You will need to be running at least Prometheus 2.39.0 to support overlapping timestamps by default.

You want to only copy the TSDB block dirs (01xxxxx..xx), and not the other files like the `wal`

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/e93b836c-ff4d-43d7-987e-81c1ccbbd9f5n%40googlegroups.com.

Nunni

unread,
Jul 5, 2023, 4:13:00 PM7/5/23
to Prometheus Users
Hello Ben.

Yes, that's exactly what I did. Stop the prometheus daemon, copy the block dirs, and then start the prometheus daemon.
But when I visit the prometheus:9090/graph url I only see the new data.

What else should I do? promtool perhaps?

I'm using version 2.43.

Best regards.

Roberto Nunnari

unread,
Jul 8, 2023, 8:46:46 AM7/8/23
to Prometheus Users
Hello.

Anybody on this?

--
You received this message because you are subscribed to a topic in the Google Groups "Prometheus Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/prometheus-users/XrpZjX1L7Bo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to prometheus-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages