How to move InfluxDB database to remote IP?

  • Platform information:
    • Hardware: _Orangepi 3 LTS
    • OS: Armbian 5

I would like to move the InfluxDB database off my SD card so I can move the entire installation to the eMMC memory of the Orangepi 3 LTS. The eMMC is about 8 GB and the SD card is currently 17 GB, of which 11 GB is InfluxDB data.

The process, that failed, was as follows:

  1. Mount the remote server folder to my Orangepi 3 LTS with sshfs
sshfs -o uid=116,gid=123 influxdb@remote.server.ip:/media/mnt/InfluxDB /var/lib/influxdb/engine/data.tmp
  1. stop InfluxDB and OpenHAB services

  2. rsync the InfluxDB database to the remote server

rsync -r -ah --info=progress2 data data.tmp
  1. Move the local data folder aside and create a new data folder for mounting
mv data data.old
umount data.tmp
mkdir data

  1. Mount the remote ip folder as local folder data
sshfs -o uid=116,gid=123 influxdb@remote.server.ip:/media/mnt/InfluxDB /var/lib/influxdb/engine/data
  1. Restart OpenHAB and InfluxDB services.

InfluxDB does not start:

Jul 24 19:04:34 orangepi3-lts systemd[1]: Starting InfluxDB is an open-source, distributed, time series database...
Jul 24 19:04:34 orangepi3-lts influxd-systemd-start.sh[261982]: Command "print-config" is deprecated, use the influx-cli command server-config to display the configuration values from >
Jul 24 19:04:34 orangepi3-lts influxd-systemd-start.sh[261981]: ts=2023-07-24T16:04:34.902582Z lvl=info msg="Welcome to InfluxDB" log_id=0jEAALqW000 version=v2.7.1 commit=407fa622e9 bu>
Jul 24 19:04:34 orangepi3-lts influxd-systemd-start.sh[261981]: ts=2023-07-24T16:04:34.907097Z lvl=info msg="Resources opened" log_id=0jEAALqW000 service=bolt path=/var/lib/influxdb/in>
Jul 24 19:04:34 orangepi3-lts influxd-systemd-start.sh[261981]: ts=2023-07-24T16:04:34.907520Z lvl=info msg="Resources opened" log_id=0jEAALqW000 service=sqlite path=/var/lib/influxdb/>
Jul 24 19:04:34 orangepi3-lts influxd-systemd-start.sh[261997]: Command "print-config" is deprecated, use the influx-cli command server-config to display the configuration values from >
Jul 24 19:04:34 orangepi3-lts influxd-systemd-start.sh[261981]: ts=2023-07-24T16:04:34.921903Z lvl=info msg="Checking InfluxDB metadata for prior version." log_id=0jEAALqW000 bolt_path>
Jul 24 19:04:34 orangepi3-lts influxd-systemd-start.sh[261981]: ts=2023-07-24T16:04:34.922232Z lvl=info msg="Using data dir" log_id=0jEAALqW000 service=storage-engine service=store pat>
Jul 24 19:04:34 orangepi3-lts influxd-systemd-start.sh[261981]: ts=2023-07-24T16:04:34.922337Z lvl=error msg="Failed to open engine" log_id=0jEAALqW000 error="mkdir /var/lib/influxdb/e>
Jul 24 19:04:34 orangepi3-lts influxd-systemd-start.sh[261981]: Error: mkdir /var/lib/influxdb/engine/data: file exists
Jul 24 19:04:34 orangepi3-lts influxd-systemd-start.sh[261981]: See 'influxd -h' for help
Jul 24 19:04:35 orangepi3-lts influxd-systemd-start.sh[262006]: Command "print-config" is deprecated, use the influx-cli command server-config to display the configuration values from >
Jul 24 19:04:35 orangepi3-lts influxd-systemd-start.sh[261980]: InfluxDB API at http://localhost:8086/ready unavailable after 1 attempts...
Jul 24 19:04:36 orangepi3-lts influxd-systemd-start.sh[261980]: InfluxDB API at http://localhost:8086/ready unavailable after 2 attempts...
Jul 24 19:04:37 orangepi3-lts influxd-systemd-start.sh[261980]: InfluxDB API at http://localhost:8086/ready unavailable after 3 attempts...
Jul 24 19:04:38 orangepi3-lts influxd-systemd-start.sh[261980]: InfluxDB API at http://localhost:8086/ready unavailable after 4 attempts...
Jul 24 19:04:39 orangepi3-lts influxd-systemd-start.sh[261980]: InfluxDB API at http://localhost:8086/ready unavailable after 5 attempts...
Jul 24 19:04:40 orangepi3-lts influxd-systemd-start.sh[261980]: InfluxDB API at http://localhost:8086/ready unavailable after 6 attempts...
Jul 24 19:04:41 orangepi3-lts influxd-systemd-start.sh[261980]: InfluxDB API at http://localhost:8086/ready unavailable after 7 attempts...
Jul 24 19:04:42 orangepi3-lts influxd-systemd-start.sh[261980]: InfluxDB API at http://localhost:8086/ready unavailable after 8 attempts...

This continues ad infinitum and makes me very confused. Why does this not work?

I’m not surprised it didn’t work. It’s been a long time since I messed with InfluxDB but when I last did the instructions I followed from the InfluxDB docs involved doing a dump and a restore, not an rsync of files.

By all appearances, InfluxDB thinks it is starting for the first time (which is true) but the stuff it wants to create as part of it’s initialization already exists.