Recreate database from TSM files?

Hi,

I have InfluxDB 1.8.1 installed on a Raspberry Pi writing TSM files to a NAS drive.
The Pi got a corrupted SD card last week and I have had to rebuild it on a new card (it was backed up but I cannot access the back up now - long unhappy story).

While everything is working again it seems that Influx has started writing to a new shard and does not know that the old data is still there. The WAL directory was on the Pi SD card so it has gone but the TSM files are on the NAS drive and are still there with 9 months of data.

Is there a way to rebuild the database from the TSM files?

TIA for any help or advice.

Simon.

Hello @Simon_K,
Oof sorry about the long unhappy story, that’s a bummer. I’m not sure, but maybe this procedure for upgrading to tsi from tsm will work for you:
http://167.114.231.105/influxdb/v1.6/administration/upgrading/

Hi @Anaisdg

thanks, that has got me a bit further.
In influxdb.conf I added the line:
index-version = “tsi1”
There were no index directories to delete.
Ran the influx_inspect buildtsi command.

If I now run a query specifying a condition that has not occurred since my disk failure (temperature = 0) I get results from 2019.
However, if I run a query specifying the time of one of the returned results in the where clause no rows are returned.

This makes me think there is an index of some sort that has not been updated.

Any more ideas?

Regards
Simon.

Hello @Simon_K,
Hmm I’m not sure. I’ll ask around.

Thanks @Anaisdg I’ve fixed it by doing an influx_inspect export followed by influx -import.
Next job is to implement a backup routine!

Thanks again.

1 Like

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