MariaDB add-on - importing database files

I’m wanting to move my existing weewx database (2yrs data, 100mb~) to the MariaDB add-on within my Hassio instance.

I’ve exported the weewx database from my existing mysql server, but can’t figure out where I need to put it so that the MariaDB docker can see it to import it.

I also have the phpmyadmin add-on installed, but the maximum filesize for import is 2mb. Increasing this to say 100-150mb would let me import through phpmyadmin, but without access to php.ini I don’t know how to increase the max import size.

Has anyone else attempted this? Can you give me some pointers?

Wether to import your db with CLI or to change the php.ini, you’ll likely need CLI access inside the docker containers (mariadb and/or phpmyadmin)

The general command to do so is, from a host os prompt

docker exec -it <container_name> bash

For anyone following along later who wants to do something like this themselves, @koying was right on the money.

I used this guide to gain access to the Host OS command line - Debugging the Home Assistant Operating System | Home Assistant Developer Docs

Then accessed the MariaDB docker using docker exec -it <container_name> bash

I then used WGET to download my backed-up .sql files to the MariaDB docker and imported them using the command line. Essentially following this guide - How To Import and Export Databases in MySQL or MariaDB | DigitalOcean

1 Like