Reconecting User Data

Hello,

Since my problem with uninstalling PiHole dependencies https://dietpi.com/forum/t/after-uninstall-crash-mnt-dietpi-no-longer-exists/6594/1

I decided to try fresh install on another SD card, my user data is on an external SSD which I mounted to the new system, but I mistakingly call it “Crucial-120GB” instead of the original name “Crucial_120GB” and assigned the disk as the user data location. I can’t find an option in the drive manager to rename the disk.

root@DietPi:~# readlink -f /mnt/dietpi_userdata
/mnt/Crucial-120GB/dietpi_userdata

The previous user data is still on the drive in the dietpi_userdata folder (I’ve also backed it up via proFTP).

But Node-Red, InfluxDB and Grafana on the new system doesn’t see the data, how do point them to the previous data on the SSD?

Thanks

sudo ln -sf /mnt/Crucial_120GB/dietpi_userdata /mnt/dietpi_userdata

This overwrites the symbolic link with the correct one. Then e.g.

sudo dietpi-services restart

to restart all services.

Thanks for that but unfortunately it didn’t change the SSD name, it’s still /mnt/Crucial-120GB/dietpi_userdata after restarting the services.

Seeing it’s a fresh system would it be easier to reinstall and then assign the right name?

Ah sorry for the misunderstanding, then:

sudo ln -sf /mnt/Crucial-120GB/dietpi_userdata /mnt/dietpi_userdata

Replace the first path in the command with whatever is the correct mount point.

But wasn’t that the symlink present before, according to your readlink output? I.e. where is the drive mounted now then which the userdata is stored?

I’m afraid that also didn’t work.

My problem is that I have a fresh system with previous node-red, InfluxDB and Grafana userdata (dashboards, nodes etc.) on an external SSD.

How can I get the fresh system to see this data?

well, keep user data as is for now. First, you would need to reinstall your system with the software required. Once done, you could try to create the link to the old user data directory and with some hope your old data are recognized. But no grantee that this might gonna work.

Best is to mount the external drive and “move” userdata to it BEFORE installing any software, so databases are migrated automatically. Use dietpi-drive_manager to mount it to any path and use the move userdata feature. It copies over only the empty directory structure but leaves existing data untouched in place.

Reinstalled DietPi_RPi-ARMv7-Bullseye, Remounted SSD, moved userdata, rebooted. Installed Node Red, InfluxDB and Grafana which fails to start.

[FAILED] DietPi-Services | ● grafana-server.service - Grafana instance
     Loaded: loaded (/lib/systemd/system/grafana-server.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2022-05-17 18:47:00 BST; 5s ago
       Docs: http://docs.grafana.org
    Process: 1961 ExecStart=/usr/sbin/grafana-server --config=${CONF_FILE} --pidfile=${PID_FILE_DIR}/grafana-server.pid --packaging=deb cfg:default.paths.logs=${LOG_DIR} cfg:default.paths.data=${DATA_DIR} cfg:default.paths.plugins=${PLUGINS_DIR} cfg:default.paths.provisioning=${PROVISIONING_CFG_DIR} (code=exited, status=1/FAILURE)
   Main PID: 1961 (code=exited, status=1/FAILURE)
        CPU: 534ms

So far still no luck, Node Red isn’t showing any of the previous dashboards :cry:

can you share following

journalctl -u grafana-server.service

Ah, probably the user IDs have changed. Try:

chown -R influxd /mnt/dietpi_userdata/influxdb
chown -R mysql /mnt/dietpi_userdata/mysql
root@DietPi:~# journalctl -u grafana-server.service
-- Journal begins at Tue 2022-05-17 19:03:37 BST, ends at Wed 2022-05-18 19:58:28 BST. --
-- No entries --

root@DietPi:~# chown -R mysql /mnt/dietpi_userdata/mysql
chown: invalid user: ‘mysql’

can you try reboot your system and check Grafana logs again?

It’s very long

root@DietPi:~# journalctl -u grafana-server.service
-- Journal begins at Thu 2022-05-19 18:25:35 BST, ends at Thu 2022-05-19 18:27:31 BST. --
May 19 18:26:45 DietPi systemd[1]: Started Grafana instance.
May 19 18:26:48 DietPi grafana-server[1409]: logger=settings t=2022-05-19T18:26:48.38+0100 lvl=info msg="Starting Grafana" version=8.5.2 commit=90701be19c branch=HEAD compiled=2022-05-03T08:44:14+01:00
May 19 18:26:48 DietPi grafana-server[1409]: logger=settings t=2022-05-19T18:26:48.39+0100 lvl=info msg="The state of unified alerting is still not defined. The decision will be made during as we run the database migrations"
May 19 18:26:48 DietPi grafana-server[1409]: logger=settings t=2022-05-19T18:26:48.39+0100 lvl=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini
May 19 18:26:48 DietPi grafana-server[1409]: logger=settings t=2022-05-19T18:26:48.39+0100 lvl=info msg="Config loaded from" file=/etc/grafana/grafana.ini
May 19 18:26:48 DietPi grafana-server[1409]: logger=settings t=2022-05-19T18:26:48.39+0100 lvl=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana"
May 19 18:26:48 DietPi grafana-server[1409]: logger=settings t=2022-05-19T18:26:48.39+0100 lvl=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana"
May 19 18:26:48 DietPi grafana-server[1409]: logger=settings t=2022-05-19T18:26:48.39+0100 lvl=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins"
May 19 18:26:48 DietPi grafana-server[1409]: logger=settings t=2022-05-19T18:26:48.39+0100 lvl=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning"
May 19 18:26:48 DietPi grafana-server[1409]: logger=settings t=2022-05-19T18:26:48.39+0100 lvl=info msg="Path Home" path=/usr/share/grafana
May 19 18:26:48 DietPi grafana-server[1409]: logger=settings t=2022-05-19T18:26:48.39+0100 lvl=info msg="Path Data" path=/var/lib/grafana
May 19 18:26:48 DietPi grafana-server[1409]: logger=settings t=2022-05-19T18:26:48.39+0100 lvl=info msg="Path Logs" path=/var/log/grafana
May 19 18:26:48 DietPi grafana-server[1409]: logger=settings t=2022-05-19T18:26:48.39+0100 lvl=info msg="Path Plugins" path=/var/lib/grafana/plugins
May 19 18:26:48 DietPi grafana-server[1409]: logger=settings t=2022-05-19T18:26:48.39+0100 lvl=info msg="Path Provisioning" path=/etc/grafana/provisioning
May 19 18:26:48 DietPi grafana-server[1409]: logger=settings t=2022-05-19T18:26:48.39+0100 lvl=info msg="App mode production"
May 19 18:26:48 DietPi grafana-server[1409]: logger=sqlstore t=2022-05-19T18:26:48.39+0100 lvl=info msg="Connecting to DB" dbtype=sqlite3
May 19 18:26:48 DietPi grafana-server[1409]: logger=migrator t=2022-05-19T18:26:48.44+0100 lvl=eror msg="failed to determine the status of alerting engine. Enable either legacy or unified alerting explicitly and try again" err="failed to verify if the 'alert' table exists: unable to open database file: permission denied"
May 19 18:26:48 DietPi systemd[1]: grafana-server.service: Main process exited, code=exited, status=1/FAILURE
May 19 18:26:48 DietPi systemd[1]: grafana-server.service: Failed with result 'exit-code'.
May 19 18:26:48 DietPi systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 1.
May 19 18:26:48 DietPi systemd[1]: Stopped Grafana instance.
May 19 18:26:48 DietPi systemd[1]: Started Grafana instance.
May 19 18:26:49 DietPi grafana-server[1438]: logger=settings t=2022-05-19T18:26:49.05+0100 lvl=info msg="Starting Grafana" version=8.5.2 commit=90701be19c branch=HEAD compiled=2022-05-03T08:44:14+01:00
May 19 18:26:49 DietPi grafana-server[1438]: logger=settings t=2022-05-19T18:26:49.05+0100 lvl=info msg="The state of unified alerting is still not defined. The decision will be made during as we run the database migrations"
May 19 18:26:49 DietPi grafana-server[1438]: logger=settings t=2022-05-19T18:26:49.05+0100 lvl=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini
May 19 18:26:49 DietPi grafana-server[1438]: logger=settings t=2022-05-19T18:26:49.05+0100 lvl=info msg="Config loaded from" file=/etc/grafana/grafana.ini
May 19 18:26:49 DietPi grafana-server[1438]: logger=settings t=2022-05-19T18:26:49.05+0100 lvl=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana"
May 19 18:26:49 DietPi grafana-server[1438]: logger=settings t=2022-05-19T18:26:49.05+0100 lvl=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana"
May 19 18:26:49 DietPi grafana-server[1438]: logger=settings t=2022-05-19T18:26:49.05+0100 lvl=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins"
May 19 18:26:49 DietPi grafana-server[1438]: logger=settings t=2022-05-19T18:26:49.05+0100 lvl=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning"
May 19 18:26:49 DietPi grafana-server[1438]: logger=settings t=2022-05-19T18:26:49.05+0100 lvl=info msg="Path Home" path=/usr/share/grafana
May 19 18:26:49 DietPi grafana-server[1438]: logger=settings t=2022-05-19T18:26:49.05+0100 lvl=info msg="Path Data" path=/var/lib/grafana
May 19 18:26:49 DietPi grafana-server[1438]: logger=settings t=2022-05-19T18:26:49.05+0100 lvl=info msg="Path Logs" path=/var/log/grafana
May 19 18:26:49 DietPi grafana-server[1438]: logger=settings t=2022-05-19T18:26:49.05+0100 lvl=info msg="Path Plugins" path=/var/lib/grafana/plugins
May 19 18:26:49 DietPi grafana-server[1438]: logger=settings t=2022-05-19T18:26:49.05+0100 lvl=info msg="Path Provisioning" path=/etc/grafana/provisioning
May 19 18:26:49 DietPi grafana-server[1438]: logger=settings t=2022-05-19T18:26:49.05+0100 lvl=info msg="App mode production"
May 19 18:26:49 DietPi grafana-server[1438]: logger=sqlstore t=2022-05-19T18:26:49.05+0100 lvl=info msg="Connecting to DB" dbtype=sqlite3
May 19 18:26:49 DietPi grafana-server[1438]: logger=migrator t=2022-05-19T18:26:49.06+0100 lvl=eror msg="failed to determine the status of alerting engine. Enable either legacy or unified alerting explicitly and try again" err="failed to verify if the 'alert' table exists: unable to open database file: permission denied"
May 19 18:26:49 DietPi systemd[1]: grafana-server.service: Main process exited, code=exited, status=1/FAILURE
May 19 18:26:49 DietPi systemd[1]: grafana-server.service: Failed with result 'exit-code'.
May 19 18:26:49 DietPi systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 2.
May 19 18:26:49 DietPi systemd[1]: Stopped Grafana instance.
May 19 18:26:49 DietPi systemd[1]: Started Grafana instance.
May 19 18:26:49 DietPi grafana-server[1448]: logger=settings t=2022-05-19T18:26:49.97+0100 lvl=info msg="Starting Grafana" version=8.5.2 commit=90701be19c branch=HEAD compiled=2022-05-03T08:44:14+01:00
May 19 18:26:49 DietPi grafana-server[1448]: logger=settings t=2022-05-19T18:26:49.98+0100 lvl=info msg="The state of unified alerting is still not defined. The decision will be made during as we run the database migrations"
May 19 18:26:49 DietPi grafana-server[1448]: logger=settings t=2022-05-19T18:26:49.98+0100 lvl=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini
May 19 18:26:49 DietPi grafana-server[1448]: logger=settings t=2022-05-19T18:26:49.98+0100 lvl=info msg="Config loaded from" file=/etc/grafana/grafana.ini
May 19 18:26:49 DietPi grafana-server[1448]: logger=settings t=2022-05-19T18:26:49.98+0100 lvl=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana"
May 19 18:26:49 DietPi grafana-server[1448]: logger=settings t=2022-05-19T18:26:49.98+0100 lvl=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana"
May 19 18:26:49 DietPi grafana-server[1448]: logger=settings t=2022-05-19T18:26:49.98+0100 lvl=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins"
May 19 18:26:49 DietPi grafana-server[1448]: logger=settings t=2022-05-19T18:26:49.98+0100 lvl=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning"
May 19 18:26:49 DietPi grafana-server[1448]: logger=settings t=2022-05-19T18:26:49.98+0100 lvl=info msg="Path Home" path=/usr/share/grafana
May 19 18:26:49 DietPi grafana-server[1448]: logger=settings t=2022-05-19T18:26:49.98+0100 lvl=info msg="Path Data" path=/var/lib/grafana
May 19 18:26:49 DietPi grafana-server[1448]: logger=settings t=2022-05-19T18:26:49.98+0100 lvl=info msg="Path Logs" path=/var/log/grafana
May 19 18:26:49 DietPi grafana-server[1448]: logger=settings t=2022-05-19T18:26:49.98+0100 lvl=info msg="Path Plugins" path=/var/lib/grafana/plugins
May 19 18:26:49 DietPi grafana-server[1448]: logger=settings t=2022-05-19T18:26:49.98+0100 lvl=info msg="Path Provisioning" path=/etc/grafana/provisioning
May 19 18:26:49 DietPi grafana-server[1448]: logger=settings t=2022-05-19T18:26:49.98+0100 lvl=info msg="App mode production"
May 19 18:26:49 DietPi grafana-server[1448]: logger=sqlstore t=2022-05-19T18:26:49.98+0100 lvl=info msg="Connecting to DB" dbtype=sqlite3
May 19 18:26:49 DietPi grafana-server[1448]: logger=migrator t=2022-05-19T18:26:49.98+0100 lvl=eror msg="failed to determine the status of alerting engine. Enable either legacy or unified alerting explicitly and try again" err="failed to verify if the 'alert' table exists: unable to open database file: permission denied"
May 19 18:26:50 DietPi systemd[1]: grafana-server.service: Main process exited, code=exited, status=1/FAILURE
May 19 18:26:50 DietPi systemd[1]: grafana-server.service: Failed with result 'exit-code'.
May 19 18:26:50 DietPi systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 3.
May 19 18:26:50 DietPi systemd[1]: Stopped Grafana instance.
May 19 18:26:50 DietPi systemd[1]: Started Grafana instance.
May 19 18:26:50 DietPi grafana-server[1511]: logger=settings t=2022-05-19T18:26:50.79+0100 lvl=info msg="Starting Grafana" version=8.5.2 commit=90701be19c branch=HEAD compiled=2022-05-03T08:44:14+01:00
May 19 18:26:50 DietPi grafana-server[1511]: logger=settings t=2022-05-19T18:26:50.79+0100 lvl=info msg="The state of unified alerting is still not defined. The decision will be made during as we run the database migrations"
May 19 18:26:50 DietPi grafana-server[1511]: logger=settings t=2022-05-19T18:26:50.8+0100 lvl=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini
May 19 18:26:50 DietPi grafana-server[1511]: logger=settings t=2022-05-19T18:26:50.8+0100 lvl=info msg="Config loaded from" file=/etc/grafana/grafana.ini
May 19 18:26:50 DietPi grafana-server[1511]: logger=settings t=2022-05-19T18:26:50.8+0100 lvl=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana"
May 19 18:26:50 DietPi grafana-server[1511]: logger=settings t=2022-05-19T18:26:50.8+0100 lvl=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana"
May 19 18:26:50 DietPi grafana-server[1511]: logger=settings t=2022-05-19T18:26:50.8+0100 lvl=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins"
May 19 18:26:50 DietPi grafana-server[1511]: logger=settings t=2022-05-19T18:26:50.8+0100 lvl=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning"
May 19 18:26:50 DietPi grafana-server[1511]: logger=settings t=2022-05-19T18:26:50.8+0100 lvl=info msg="Path Home" path=/usr/share/grafana
May 19 18:26:50 DietPi grafana-server[1511]: logger=settings t=2022-05-19T18:26:50.8+0100 lvl=info msg="Path Data" path=/var/lib/grafana
May 19 18:26:50 DietPi grafana-server[1511]: logger=settings t=2022-05-19T18:26:50.8+0100 lvl=info msg="Path Logs" path=/var/log/grafana
May 19 18:26:50 DietPi grafana-server[1511]: logger=settings t=2022-05-19T18:26:50.8+0100 lvl=info msg="Path Plugins" path=/var/lib/grafana/plugins
May 19 18:26:50 DietPi grafana-server[1511]: logger=settings t=2022-05-19T18:26:50.8+0100 lvl=info msg="Path Provisioning" path=/etc/grafana/provisioning
May 19 18:26:50 DietPi grafana-server[1511]: logger=settings t=2022-05-19T18:26:50.8+0100 lvl=info msg="App mode production"
May 19 18:26:50 DietPi grafana-server[1511]: logger=sqlstore t=2022-05-19T18:26:50.8+0100 lvl=info msg="Connecting to DB" dbtype=sqlite3
May 19 18:26:50 DietPi grafana-server[1511]: logger=migrator t=2022-05-19T18:26:50.8+0100 lvl=eror msg="failed to determine the status of alerting engine. Enable either legacy or unified alerting explicitly and try again" err="failed to verify if the 'alert' table exists: unable to open database file: permission denied"
May 19 18:26:50 DietPi systemd[1]: grafana-server.service: Main process exited, code=exited, status=1/FAILURE
May 19 18:26:50 DietPi systemd[1]: grafana-server.service: Failed with result 'exit-code'.
May 19 18:26:51 DietPi systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 4.
May 19 18:26:51 DietPi systemd[1]: Stopped Grafana instance.
May 19 18:26:51 DietPi systemd[1]: Started Grafana instance.
May 19 18:26:51 DietPi grafana-server[1537]: logger=settings t=2022-05-19T18:26:51.76+0100 lvl=info msg="Starting Grafana" version=8.5.2 commit=90701be19c branch=HEAD compiled=2022-05-03T08:44:14+01:00
May 19 18:26:51 DietPi grafana-server[1537]: logger=settings t=2022-05-19T18:26:51.76+0100 lvl=info msg="The state of unified alerting is still not defined. The decision will be made during as we run the database migrations"
May 19 18:26:51 DietPi grafana-server[1537]: logger=settings t=2022-05-19T18:26:51.76+0100 lvl=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini
May 19 18:26:51 DietPi grafana-server[1537]: logger=settings t=2022-05-19T18:26:51.76+0100 lvl=info msg="Config loaded from" file=/etc/grafana/grafana.ini
May 19 18:26:51 DietPi grafana-server[1537]: logger=settings t=2022-05-19T18:26:51.76+0100 lvl=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana"
May 19 18:26:51 DietPi grafana-server[1537]: logger=settings t=2022-05-19T18:26:51.76+0100 lvl=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana"
May 19 18:26:51 DietPi grafana-server[1537]: logger=settings t=2022-05-19T18:26:51.76+0100 lvl=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins"
May 19 18:26:51 DietPi grafana-server[1537]: logger=settings t=2022-05-19T18:26:51.76+0100 lvl=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning"
May 19 18:26:51 DietPi grafana-server[1537]: logger=settings t=2022-05-19T18:26:51.77+0100 lvl=info msg="Path Home" path=/usr/share/grafana
May 19 18:26:51 DietPi grafana-server[1537]: logger=settings t=2022-05-19T18:26:51.77+0100 lvl=info msg="Path Data" path=/var/lib/grafana
May 19 18:26:51 DietPi grafana-server[1537]: logger=settings t=2022-05-19T18:26:51.77+0100 lvl=info msg="Path Logs" path=/var/log/grafana
May 19 18:26:51 DietPi grafana-server[1537]: logger=settings t=2022-05-19T18:26:51.77+0100 lvl=info msg="Path Plugins" path=/var/lib/grafana/plugins
May 19 18:26:51 DietPi grafana-server[1537]: logger=settings t=2022-05-19T18:26:51.77+0100 lvl=info msg="Path Provisioning" path=/etc/grafana/provisioning
May 19 18:26:51 DietPi grafana-server[1537]: logger=settings t=2022-05-19T18:26:51.77+0100 lvl=info msg="App mode production"
May 19 18:26:51 DietPi grafana-server[1537]: logger=sqlstore t=2022-05-19T18:26:51.77+0100 lvl=info msg="Connecting to DB" dbtype=sqlite3
May 19 18:26:51 DietPi grafana-server[1537]: logger=migrator t=2022-05-19T18:26:51.77+0100 lvl=eror msg="failed to determine the status of alerting engine. Enable either legacy or unified alerting explicitly and try again" err="failed to verify if the 'alert' table exists: unable to open database file: permission denied"
May 19 18:26:51 DietPi systemd[1]: grafana-server.service: Main process exited, code=exited, status=1/FAILURE
May 19 18:26:51 DietPi systemd[1]: grafana-server.service: Failed with result 'exit-code'.
May 19 18:26:52 DietPi systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 5.
May 19 18:26:52 DietPi systemd[1]: Stopped Grafana instance.
May 19 18:26:52 DietPi systemd[1]: grafana-server.service: Start request repeated too quickly.
May 19 18:26:52 DietPi systemd[1]: grafana-server.service: Failed with result 'exit-code'.
May 19 18:26:52 DietPi systemd[1]: Failed to start Grafana instance.
May 19 18:27:28 DietPi systemd[1]: Started Grafana instance.
May 19 18:27:28 DietPi grafana-server[1916]: logger=settings t=2022-05-19T18:27:28.48+0100 lvl=info msg="Starting Grafana" version=8.5.2 commit=90701be19c branch=HEAD compiled=2022-05-03T08:44:14+01:00
May 19 18:27:28 DietPi grafana-server[1916]: logger=settings t=2022-05-19T18:27:28.48+0100 lvl=info msg="The state of unified alerting is still not defined. The decision will be made during as we run the database migrations"
May 19 18:27:28 DietPi grafana-server[1916]: logger=settings t=2022-05-19T18:27:28.48+0100 lvl=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini
May 19 18:27:28 DietPi grafana-server[1916]: logger=settings t=2022-05-19T18:27:28.48+0100 lvl=info msg="Config loaded from" file=/etc/grafana/grafana.ini
May 19 18:27:28 DietPi grafana-server[1916]: logger=settings t=2022-05-19T18:27:28.48+0100 lvl=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana"
May 19 18:27:28 DietPi grafana-server[1916]: logger=settings t=2022-05-19T18:27:28.48+0100 lvl=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana"
May 19 18:27:28 DietPi grafana-server[1916]: logger=settings t=2022-05-19T18:27:28.48+0100 lvl=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins"
May 19 18:27:28 DietPi grafana-server[1916]: logger=settings t=2022-05-19T18:27:28.48+0100 lvl=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning"
May 19 18:27:28 DietPi grafana-server[1916]: logger=settings t=2022-05-19T18:27:28.48+0100 lvl=info msg="Path Home" path=/usr/share/grafana
May 19 18:27:28 DietPi grafana-server[1916]: logger=settings t=2022-05-19T18:27:28.48+0100 lvl=info msg="Path Data" path=/var/lib/grafana
May 19 18:27:28 DietPi grafana-server[1916]: logger=settings t=2022-05-19T18:27:28.48+0100 lvl=info msg="Path Logs" path=/var/log/grafana
May 19 18:27:28 DietPi grafana-server[1916]: logger=settings t=2022-05-19T18:27:28.48+0100 lvl=info msg="Path Plugins" path=/var/lib/grafana/plugins
May 19 18:27:28 DietPi grafana-server[1916]: logger=settings t=2022-05-19T18:27:28.48+0100 lvl=info msg="Path Provisioning" path=/etc/grafana/provisioning
May 19 18:27:28 DietPi grafana-server[1916]: logger=settings t=2022-05-19T18:27:28.48+0100 lvl=info msg="App mode production"
May 19 18:27:28 DietPi grafana-server[1916]: logger=sqlstore t=2022-05-19T18:27:28.48+0100 lvl=info msg="Connecting to DB" dbtype=sqlite3
May 19 18:27:28 DietPi grafana-server[1916]: logger=migrator t=2022-05-19T18:27:28.49+0100 lvl=eror msg="failed to determine the status of alerting engine. Enable either legacy or unified alerting explicitly and try again" err="failed to verify if the 'alert' table exists: unable to open database file: permission denied"
May 19 18:27:28 DietPi systemd[1]: grafana-server.service: Main process exited, code=exited, status=1/FAILURE
May 19 18:27:28 DietPi systemd[1]: grafana-server.service: Failed with result 'exit-code'.
May 19 18:27:28 DietPi systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 1.
May 19 18:27:28 DietPi systemd[1]: Stopped Grafana instance.
May 19 18:27:28 DietPi systemd[1]: Started Grafana instance.
May 19 18:27:29 DietPi grafana-server[1937]: logger=settings t=2022-05-19T18:27:29.28+0100 lvl=info msg="Starting Grafana" version=8.5.2 commit=90701be19c branch=HEAD compiled=2022-05-03T08:44:14+01:00
May 19 18:27:29 DietPi grafana-server[1937]: logger=settings t=2022-05-19T18:27:29.28+0100 lvl=info msg="The state of unified alerting is still not defined. The decision will be made during as we run the database migrations"
May 19 18:27:29 DietPi grafana-server[1937]: logger=settings t=2022-05-19T18:27:29.28+0100 lvl=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini
May 19 18:27:29 DietPi grafana-server[1937]: logger=settings t=2022-05-19T18:27:29.28+0100 lvl=info msg="Config loaded from" file=/etc/grafana/grafana.ini
May 19 18:27:29 DietPi grafana-server[1937]: logger=settings t=2022-05-19T18:27:29.28+0100 lvl=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana"
May 19 18:27:29 DietPi grafana-server[1937]: logger=settings t=2022-05-19T18:27:29.28+0100 lvl=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana"
May 19 18:27:29 DietPi grafana-server[1937]: logger=settings t=2022-05-19T18:27:29.28+0100 lvl=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins"
May 19 18:27:29 DietPi grafana-server[1937]: logger=settings t=2022-05-19T18:27:29.28+0100 lvl=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning"
May 19 18:27:29 DietPi grafana-server[1937]: logger=settings t=2022-05-19T18:27:29.28+0100 lvl=info msg="Path Home" path=/usr/share/grafana
May 19 18:27:29 DietPi grafana-server[1937]: logger=settings t=2022-05-19T18:27:29.28+0100 lvl=info msg="Path Data" path=/var/lib/grafana
May 19 18:27:29 DietPi grafana-server[1937]: logger=settings t=2022-05-19T18:27:29.28+0100 lvl=info msg="Path Logs" path=/var/log/grafana
May 19 18:27:29 DietPi grafana-server[1937]: logger=settings t=2022-05-19T18:27:29.28+0100 lvl=info msg="Path Plugins" path=/var/lib/grafana/plugins
May 19 18:27:29 DietPi grafana-server[1937]: logger=settings t=2022-05-19T18:27:29.28+0100 lvl=info msg="Path Provisioning" path=/etc/grafana/provisioning
May 19 18:27:29 DietPi grafana-server[1937]: logger=settings t=2022-05-19T18:27:29.28+0100 lvl=info msg="App mode production"
May 19 18:27:29 DietPi grafana-server[1937]: logger=sqlstore t=2022-05-19T18:27:29.28+0100 lvl=info msg="Connecting to DB" dbtype=sqlite3
May 19 18:27:29 DietPi grafana-server[1937]: logger=migrator t=2022-05-19T18:27:29.28+0100 lvl=eror msg="failed to determine the status of alerting engine. Enable either legacy or unified alerting explicitly and try again" err="failed to verify if the 'alert' table exists: unable to open database file: permission denied"
May 19 18:27:29 DietPi systemd[1]: grafana-server.service: Main process exited, code=exited, status=1/FAILURE
May 19 18:27:29 DietPi systemd[1]: grafana-server.service: Failed with result 'exit-code'.
May 19 18:27:29 DietPi systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 2.
May 19 18:27:29 DietPi systemd[1]: Stopped Grafana instance.
May 19 18:27:29 DietPi systemd[1]: Started Grafana instance.
May 19 18:27:30 DietPi grafana-server[1947]: logger=settings t=2022-05-19T18:27:30+0100 lvl=info msg="Starting Grafana" version=8.5.2 commit=90701be19c branch=HEAD compiled=2022-05-03T08:44:14+01:00
May 19 18:27:30 DietPi grafana-server[1947]: logger=settings t=2022-05-19T18:27:30+0100 lvl=info msg="The state of unified alerting is still not defined. The decision will be made during as we run the database migrations"
May 19 18:27:30 DietPi grafana-server[1947]: logger=settings t=2022-05-19T18:27:30+0100 lvl=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini
May 19 18:27:30 DietPi grafana-server[1947]: logger=settings t=2022-05-19T18:27:30+0100 lvl=info msg="Config loaded from" file=/etc/grafana/grafana.ini
May 19 18:27:30 DietPi grafana-server[1947]: logger=settings t=2022-05-19T18:27:30+0100 lvl=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana"
May 19 18:27:30 DietPi grafana-server[1947]: logger=settings t=2022-05-19T18:27:30+0100 lvl=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana"
May 19 18:27:30 DietPi grafana-server[1947]: logger=settings t=2022-05-19T18:27:30+0100 lvl=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins"
May 19 18:27:30 DietPi grafana-server[1947]: logger=settings t=2022-05-19T18:27:30+0100 lvl=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning"
May 19 18:27:30 DietPi grafana-server[1947]: logger=settings t=2022-05-19T18:27:30+0100 lvl=info msg="Path Home" path=/usr/share/grafana
May 19 18:27:30 DietPi grafana-server[1947]: logger=settings t=2022-05-19T18:27:30+0100 lvl=info msg="Path Data" path=/var/lib/grafana
May 19 18:27:30 DietPi grafana-server[1947]: logger=settings t=2022-05-19T18:27:30+0100 lvl=info msg="Path Logs" path=/var/log/grafana
May 19 18:27:30 DietPi grafana-server[1947]: logger=settings t=2022-05-19T18:27:30+0100 lvl=info msg="Path Plugins" path=/var/lib/grafana/plugins
May 19 18:27:30 DietPi grafana-server[1947]: logger=settings t=2022-05-19T18:27:30+0100 lvl=info msg="Path Provisioning" path=/etc/grafana/provisioning
May 19 18:27:30 DietPi grafana-server[1947]: logger=settings t=2022-05-19T18:27:30+0100 lvl=info msg="App mode production"
May 19 18:27:30 DietPi grafana-server[1947]: logger=sqlstore t=2022-05-19T18:27:30+0100 lvl=info msg="Connecting to DB" dbtype=sqlite3
May 19 18:27:30 DietPi grafana-server[1947]: logger=migrator t=2022-05-19T18:27:30.01+0100 lvl=eror msg="failed to determine the status of alerting engine. Enable either legacy or unified alerting explicitly and try again" err="failed to verify if the 'alert' table exists: unable to open database file: permission denied"
May 19 18:27:30 DietPi systemd[1]: grafana-server.service: Main process exited, code=exited, status=1/FAILURE
May 19 18:27:30 DietPi systemd[1]: grafana-server.service: Failed with result 'exit-code'.
May 19 18:27:30 DietPi systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 3.
May 19 18:27:30 DietPi systemd[1]: Stopped Grafana instance.
May 19 18:27:30 DietPi systemd[1]: Started Grafana instance.
May 19 18:27:30 DietPi grafana-server[1957]: logger=settings t=2022-05-19T18:27:30.76+0100 lvl=info msg="Starting Grafana" version=8.5.2 commit=90701be19c branch=HEAD compiled=2022-05-03T08:44:14+01:00
May 19 18:27:30 DietPi grafana-server[1957]: logger=settings t=2022-05-19T18:27:30.76+0100 lvl=info msg="The state of unified alerting is still not defined. The decision will be made during as we run the database migrations"
May 19 18:27:30 DietPi grafana-server[1957]: logger=settings t=2022-05-19T18:27:30.76+0100 lvl=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini
May 19 18:27:30 DietPi grafana-server[1957]: logger=settings t=2022-05-19T18:27:30.76+0100 lvl=info msg="Config loaded from" file=/etc/grafana/grafana.ini
May 19 18:27:30 DietPi grafana-server[1957]: logger=settings t=2022-05-19T18:27:30.76+0100 lvl=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana"
May 19 18:27:30 DietPi grafana-server[1957]: logger=settings t=2022-05-19T18:27:30.76+0100 lvl=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana"
May 19 18:27:30 DietPi grafana-server[1957]: logger=settings t=2022-05-19T18:27:30.76+0100 lvl=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins"
May 19 18:27:30 DietPi grafana-server[1957]: logger=settings t=2022-05-19T18:27:30.76+0100 lvl=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning"
May 19 18:27:30 DietPi grafana-server[1957]: logger=settings t=2022-05-19T18:27:30.76+0100 lvl=info msg="Path Home" path=/usr/share/grafana
May 19 18:27:30 DietPi grafana-server[1957]: logger=settings t=2022-05-19T18:27:30.76+0100 lvl=info msg="Path Data" path=/var/lib/grafana
May 19 18:27:30 DietPi grafana-server[1957]: logger=settings t=2022-05-19T18:27:30.76+0100 lvl=info msg="Path Logs" path=/var/log/grafana
May 19 18:27:30 DietPi grafana-server[1957]: logger=settings t=2022-05-19T18:27:30.76+0100 lvl=info msg="Path Plugins" path=/var/lib/grafana/plugins
May 19 18:27:30 DietPi grafana-server[1957]: logger=settings t=2022-05-19T18:27:30.76+0100 lvl=info msg="Path Provisioning" path=/etc/grafana/provisioning
May 19 18:27:30 DietPi grafana-server[1957]: logger=settings t=2022-05-19T18:27:30.76+0100 lvl=info msg="App mode production"
May 19 18:27:30 DietPi grafana-server[1957]: logger=sqlstore t=2022-05-19T18:27:30.76+0100 lvl=info msg="Connecting to DB" dbtype=sqlite3
May 19 18:27:30 DietPi grafana-server[1957]: logger=migrator t=2022-05-19T18:27:30.76+0100 lvl=eror msg="failed to determine the status of alerting engine. Enable either legacy or unified alerting explicitly and try again" err="failed to verify if the 'alert' table exists: unable to open database file: permission denied"
May 19 18:27:30 DietPi systemd[1]: grafana-server.service: Main process exited, code=exited, status=1/FAILURE
May 19 18:27:30 DietPi systemd[1]: grafana-server.service: Failed with result 'exit-code'.
May 19 18:27:31 DietPi systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 4.
May 19 18:27:31 DietPi systemd[1]: Stopped Grafana instance.
May 19 18:27:31 DietPi systemd[1]: Started Grafana instance.
May 19 18:27:31 DietPi grafana-server[1967]: logger=settings t=2022-05-19T18:27:31.51+0100 lvl=info msg="Starting Grafana" version=8.5.2 commit=90701be19c branch=HEAD compiled=2022-05-03T08:44:14+01:00
May 19 18:27:31 DietPi grafana-server[1967]: logger=settings t=2022-05-19T18:27:31.51+0100 lvl=info msg="The state of unified alerting is still not defined. The decision will be made during as we run the database migrations"
May 19 18:27:31 DietPi grafana-server[1967]: logger=settings t=2022-05-19T18:27:31.51+0100 lvl=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini
May 19 18:27:31 DietPi grafana-server[1967]: logger=settings t=2022-05-19T18:27:31.51+0100 lvl=info msg="Config loaded from" file=/etc/grafana/grafana.ini
May 19 18:27:31 DietPi grafana-server[1967]: logger=settings t=2022-05-19T18:27:31.51+0100 lvl=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana"
May 19 18:27:31 DietPi grafana-server[1967]: logger=settings t=2022-05-19T18:27:31.51+0100 lvl=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana"
May 19 18:27:31 DietPi grafana-server[1967]: logger=settings t=2022-05-19T18:27:31.51+0100 lvl=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins"
May 19 18:27:31 DietPi grafana-server[1967]: logger=settings t=2022-05-19T18:27:31.51+0100 lvl=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning"
May 19 18:27:31 DietPi grafana-server[1967]: logger=settings t=2022-05-19T18:27:31.51+0100 lvl=info msg="Path Home" path=/usr/share/grafana
May 19 18:27:31 DietPi grafana-server[1967]: logger=settings t=2022-05-19T18:27:31.51+0100 lvl=info msg="Path Data" path=/var/lib/grafana
May 19 18:27:31 DietPi grafana-server[1967]: logger=settings t=2022-05-19T18:27:31.51+0100 lvl=info msg="Path Logs" path=/var/log/grafana
May 19 18:27:31 DietPi grafana-server[1967]: logger=settings t=2022-05-19T18:27:31.51+0100 lvl=info msg="Path Plugins" path=/var/lib/grafana/plugins
May 19 18:27:31 DietPi grafana-server[1967]: logger=settings t=2022-05-19T18:27:31.51+0100 lvl=info msg="Path Provisioning" path=/etc/grafana/provisioning
May 19 18:27:31 DietPi grafana-server[1967]: logger=settings t=2022-05-19T18:27:31.51+0100 lvl=info msg="App mode production"
May 19 18:27:31 DietPi grafana-server[1967]: logger=sqlstore t=2022-05-19T18:27:31.51+0100 lvl=info msg="Connecting to DB" dbtype=sqlite3
May 19 18:27:31 DietPi grafana-server[1967]: logger=migrator t=2022-05-19T18:27:31.51+0100 lvl=eror msg="failed to determine the status of alerting engine. Enable either legacy or unified alerting explicitly and try again" err="failed to verify if the 'alert' table exists: unable to open database file: permission denied"
May 19 18:27:31 DietPi systemd[1]: grafana-server.service: Main process exited, code=exited, status=1/FAILURE
May 19 18:27:31 DietPi systemd[1]: grafana-server.service: Failed with result 'exit-code'.
May 19 18:27:31 DietPi systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 5.
May 19 18:27:31 DietPi systemd[1]: Stopped Grafana instance.
May 19 18:27:31 DietPi systemd[1]: grafana-server.service: Start request repeated too quickly.
May 19 18:27:31 DietPi systemd[1]: grafana-server.service: Failed with result 'exit-code'.
May 19 18:27:31 DietPi systemd[1]: Failed to start Grafana instance.

looks like some permission issues. Can you share following

ls -la /mnt/dietpi_userdata/grafana
root@DietPi:~# ls -la /mnt/dietpi_userdata/grafana
total 808
drwxr-xr-x  7 dietpi dietpi   4096 May 15 11:17 .
drwxrwxr-x 10 dietpi dietpi   4096 May 17 18:30 ..
drwxr-x---  3 dietpi dietpi   4096 May 12 19:28 alerting
drwx------  2 dietpi dietpi   4096 May 12 19:28 csv
-rw-r-----  1 dietpi dietpi 798720 May 15 11:17 grafana.db
drwxrwxr-x  5 dietpi dietpi   4096 Jan 26  2020 plugins
drwx------  2 dietpi dietpi   4096 May 12 19:28 png
drwx------  2 dietpi dietpi   4096 May 12 19:28 storage

pls try following

chown -R grafana /mnt/dietpi_userdata/grafana
systemctl restart grafana-server.service

Great thanks now it’s working, but I still can’t see the old data (node-red, InfluxDB, Grafana)

Node-RED already has the right owner?

chown -R nodered /mnt/dietpi_userdata/nodered

You mean Grafana and Node-RED do not show your previously generated content?

Yes sorry that is what I mean.

node red folder is named /mnt/dietpi_userdata/node-red

root@DietPi:~# ls -la /mnt/dietpi_userdata/node-red
total 632
drwxr-xr-x   7 nodered nodered   4096 May 16 20:13 .
drwxrwxr-x  10 dietpi  dietpi    4096 May 17 18:30 ..
drwxr-xr-x   3 nodered nodered   4096 May 12 19:03 .cache
-rw-r--r--   1 nodered nodered  40701 Apr  5 17:24 .config.json
-rw-r--r--   1 nodered nodered  40701 Jan 26 21:15 .config.json.backup
-rw-r--r--   1 nodered nodered      2 Apr  9 18:55 .config.modules.json
-rw-r--r--   1 nodered nodered  14795 May 16 20:13 .config.nodes.json
-rw-r--r--   1 nodered nodered  58731 May 16 20:13 .config.nodes.json.backup
-rw-r--r--   1 nodered nodered      2 Apr  9 18:55 .config.projects.json
-rw-r--r--   1 nodered nodered     95 May 12 19:28 .config.runtime.json
-rw-r--r--   1 nodered nodered    543 May 12 19:36 .config.users.json
-rw-r--r--   1 nodered nodered    468 May 12 19:36 .config.users.json.backup
-rw-r--r--   1 nodered nodered  75625 Apr 17 14:52 .flows_DietPi.json.backup
-rw-r--r--   1 nodered nodered    584 Mar 26 09:02 .flows_DietPi_cred.json.backup
drwxr-xr-x   4 nodered nodered   4096 May 12 19:02 .npm
-rw-r--r--   1 nodered nodered  75624 Apr 17 14:52 flows_DietPi.json
-rw-r--r--   1 nodered nodered    612 Mar 26 09:31 flows_DietPi_cred.json
drwxr-xr-x   2 nodered nodered   4096 Jun  5  2019 homekit-persist
drwxr-xr-x   3 nodered nodered   4096 May 12 19:28 lib
-rw-r--r--   1 nodered nodered      2 Mar  7  2021 node-red-contrib-home-assistant-websocket.json
drwxr-xr-x 252 nodered nodered  36864 May 16 20:06 node_modules
-rw-r--r--   1 nodered nodered 203824 May 17 18:39 package-lock.json
-rw-r--r--   1 nodered nodered     53 May 12 19:04 package.json
-rw-r--r--   1 nodered nodered  20498 May 12 19:28 settings.js

After

chown -R nodered /mnt/dietpi_userdata/node-red

So the old data is actually there (Node-RED). Depending on when you reinstalled/updated it last, probably the files need to go into a subdir. We changed it from a global module to a local one some versions ago, probably this was not picked up nicely on a fresh install compared to a reinstall. I’ll check that.