I just ran into a similar issue so I thought I’d post my solution in case anyone else stumbles across this like I did.
I installed the InfluxDB Home Assistant add-in to get InfluxDB on my new computer. I then created a database and tested writing data to it from Node-RED. Once I had this working I started the restore process. Note: I captured my backup before I started inserting data into my new database so there was no duplicate data.
I backed up the database with this command (make sure to stop the data from being written to the database being backed up)
influxd backup -portable /home/olduser/influxdbbackup
I then copied the influxdbbackup directory to the new computer and placed it in my Documents folder.
I needed to find the storage the Docker container has access to. I found the “binds” section after running the command below which tells me I can put the data into the /data or /share folders.
docker container inspect 6728455ebcd8
Here is part of the result:
“HostConfig”: {
“Binds”: [
“/home/newuser/Docker/hassio/ssl:/ssl:ro”,
“/home/newuser/Docker/hassio/share:/share:rw”
],
Then I ran this command to copy the backup files to a location that the InfluxDB container can access (/share):
sudo cp /home/newuser/Documents/influxdbbackup /home/newuser/Docker/hassio/share -r
To get in to the docker container I logged in to the new laptop and used Docker Exec
docker exec -it addon_a0d7b954_influxdb bash
I then navigated to the share folder with this command:
cd share/influxdbbackup
Because I already had the database created I used this command to restore the data to a temporary database.
influxd restore -portable -db OriginalDatabaseName -newdb TempDBName /share/influxdbbackup
I then ran this to merge the data into my existing, new database:
influx -database TempDBName -username YourUserName -password YourPassword
SELECT * INTO ExistingDatabase..:MEASUREMENT FROM /.*/ GROUP BY *