由于数据库名称中的点而无法还原数据

时间:2018-10-02 08:41:11

标签: influxdb database-backups

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个点。

有没有解决方法?

1 个答案:

答案 0 :(得分:0)

我没有找到解决此问题的最佳方法,所以我手动将数据复制并粘贴到InfluxDB。