由于数据库名称中有点,无法恢复数据
Cannot restore data because of dot in database name
InfluxDB-版本:1.6.3
我使用旧备份格式创建了名为“test.mydb”的数据库备份:
influxd backup -database <mydatabase> <path-to-backup>
备份很顺利,但当我尝试恢复时:
sudo influxd restore -db "test.mydb" -newdb "test.mydb" -datadir /var/lib/influxdb/data /home/ubuntu/influxdb/test.mydb/
我收到错误:backup tarfile name incorrect format
。
搜索后我认为是因为influxdb/cmd/influxd/restore/restore.go
中的这段代码:
// should get us ["db","rp", "00001", "00"]
pathParts := strings.Split(filepath.Base(tarFile), ".")
if len(pathParts) != 4 {
return fmt.Errorf("backup tarfile name incorrect format")
}
它检查备份文件名中有多少个点。数量需要为 4,但由于我的数据库名称,文件有 5 个点。
有什么解决方法吗?
我没有找到解决这个问题的最佳方案,所以我手动将数据复制并粘贴到 InfluxDB。
InfluxDB-版本:1.6.3
我使用旧备份格式创建了名为“test.mydb”的数据库备份:
influxd backup -database <mydatabase> <path-to-backup>
备份很顺利,但当我尝试恢复时:
sudo influxd restore -db "test.mydb" -newdb "test.mydb" -datadir /var/lib/influxdb/data /home/ubuntu/influxdb/test.mydb/
我收到错误:backup tarfile name incorrect format
。
搜索后我认为是因为influxdb/cmd/influxd/restore/restore.go
中的这段代码:
// should get us ["db","rp", "00001", "00"]
pathParts := strings.Split(filepath.Base(tarFile), ".")
if len(pathParts) != 4 {
return fmt.Errorf("backup tarfile name incorrect format")
}
它检查备份文件名中有多少个点。数量需要为 4,但由于我的数据库名称,文件有 5 个点。
有什么解决方法吗?
我没有找到解决这个问题的最佳方案,所以我手动将数据复制并粘贴到 InfluxDB。