使用taosdump备份指定时间范围内容的数据,导入本地后查询无数据

【TDengine 使用环境】
生产环境

【TDengine 版本】3.3.3.0

【操作系统以及版本】

【部署方式】容器

【集群节点数】1

【集群副本数】1

【描述业务影响】

【遇到的问题:问题现象及影响】

使用命令导出指定时间范围内的数据到本地目录,再将数据导入到本地的tdengine
查询本地无数据,但超级表、子表都在

使用命令如下:

# 先使用全量备份,恢复后是有数据,但数量不对
taosdump -h 192.168.110.127 -P 6030 -D kj360_cluster -o E:\\taos 

# 删除目录下所有文件和本地数据库,备份指定时间范围内的数据,导入后,无数据
taosdump -h 192.168.110.127 -P 6030 -D kj360_cluster -o E:\\taos -S ‘2025-10-22’ -E ‘2025-10-24’

taosdump -i E:\\taos -h localhost -P 6030

生产环境查询是有数据的:数量为 5288

全量备份后恢复:数量为 626

全量导出,输出的ok信息如下

OK: Database: kj360_cluster exists
OK: total 1 table(s) of stable: stable_substation_data schema dumped.
OK: total 2446 table(s) of stable: point_alarm_data schema dumped.
OK: total 2401 table(s) of stable: point_data schema dumped.
OK: total 2446 table(s) of stable: point_change_data schema dumped.
OK: total 1 table(s) of stable: stable_sensor_data schema dumped.
OK: total 1 table(s) of stable: stable_application_heartbeat schema dumped.
OK: total 99 table(s) of stable: substation_change_data schema dumped.
OK: total 0 table(s) of stable: feed_alarm_data schema dumped.
OK: total 1 table(s) of stable: stable_alarm_data schema dumped.
OK: Database kj360_cluster dumped
OK: 49575766 row(s) dumped out!

全量导入结束,输出 :OK: 49575766 row(s) dumped in!

集群是有几个节点?我看explorer的IP是192.168.110.127,导出时指定的IP是123,确定是导出正确吗?

集群是1个节点,上面的123地址是准备发在群里面,弄的假地址,发到论坛没改回来,执行的时候是 127

已编辑上面的信息,另外添加了导入导出时的部分输出内容,论坛不能上传txt,控制台输出的内容分别保存了下来

问题已解决,时区不同,查询和导出,均设置时区,导入后数据一致

taosdump -h 192.168.110.127 -P 6030 -D kj360_cluster -o E:\\taos -S '2025-10-22T00:00:00+0800' -E '2025-10-24T00:00:00+0800'

select count(1) from kj360_cluster.point_data WHERE ts >'2025-10-22T00:00:00+0800' AND ts <'2025-10-24T00:00:00+0800'
1 个赞