Hello, I am planning to migrate my MariaDB database running on the HA node to a Synology NAS (DS920+) to have the benefits of the NAS for data protection…
Anyone was succesful doing a similar migration ?
What were the steps to make sure the database was transferred keeping data integrity… (Stopping the recorder before executing a backup ? or redirect to the new database/restart HA/backup the old database (without having updates on it)/stop HA/restore the database on the new instance and restart HA)
Sofar I have MariaDB installed on the Synology NAS and remote access enabled… Quite simple… but for the rest…
Based on that video (but this is a full move), I understand the following steps:
create the hass database on the Synology NAS + the required username/password and grant access
stop MariaDB on the HA node
create a snapshot for MariaDB Add-On
when complete, change the URL to MariaDB database to redirect HA to the synology NAS
restart HA
… from here I am not sure at all for the following steps…
execute the service “recorder_disable”
restore the MariaDB snapshot ??? this restore, will it be done on the remote database (based on the URL known by HA and changed above) or the local one ???
Delay: not visible to me, probably there is one but is it big enough to be important? I assume the machines are close/next to one another on a cabled network without much processes (security/firewall/etc.) in-between.
On the db move/copy, my experiences so far … noting that I use HA docker…no add-on.
Case: I create copies ‘regularly’ e.g. when HA provides an update and I want to test this with a (recent) copy of my db…seen too many postings where Mariadb had issues after an HA upgrade for whatever reason.
So, I copy the main db to another upgrade db and start verifying from my upgrade HA instance. For this I use phpMyAdmin to connect to one, extract and import into the other… which in most cases works fine.
You can try this out first even without closing the source and see how that load works, then when you are fully ready to migrate, close the source indeed.
My Nas (synology D920+) is close to the HA node (NUC8i5BEK2) and connected via cable… So the delay should be minimum… Another way to transfer is to use mysqldump (backuping without having updates on MariaDB) from another Raspberry Pi and restoring the data on Synology using also mysqldump… The backup of my HA database took about 11 minutes (It’s a 11GB database opened for updates during the backup)…
Any tool to test the responsiveness of the current database (on NUC) and future one (on Synology) ?
I did not migrate… It was taking too much time to restore the database. I finally kept the database on the NUC running Home Assistant. As I was planning to stop HA for the backup/restore (to avoid updates), I had to stop the service for hours… so I stopped thinking about the migration.