Migrating MariaDB from HassOS to Synology NAS ? Steps?

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…

Thanks !

Discussed and showcased in this video, including MariaDB.

1 Like

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 ???
  • execute the service “recorder_enable”
  • done ?

Am I right or missing something ?

Have same idea. But I wanna know what speed delay you have when you use the dB on Synology instead of HA system itself… There will be a delay right?

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.

1 Like

What I know latest MariaDB add-on can be backup without stopping it. It has a Freeze sort of mechanism so the backup db’s are not corrupt anymore…

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) ?

Hi I want to do the same thing… migrate from HasOs to my synology….
How to backup my Maria.db to 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.

You can look at this article to backup/restore:

or this one…

1 Like

Hi, did you made it and could you tell something about the performance with the db on the NAS?

Thanks, Steffen

No … as explained it was lasting way too long to restore the database on the NAS… So I have no idea about the performance… Sorry…