How to create brand new database

Hello everyone,
recorder.purge was not working on my database and I wanted to start over with a brand new database. Using phpMyAdmin I dropped the home assistant database. Unfortunately home assistant did not create a new one on boot but rather prefers to tell me that there is a problem :smiley:

How can I make my home assistant supervised initiate a new database? I found nothing in the docs.

Thank you
Alex

If you are using the default database just delete the file config/home-assistant_v2.db and restart Home Assistant. It will create a new one.

That’s what I thought. And that is incorrect.

What makes you say that?

Navigate to the actual file directory and delete the file. No bobby table drops. The whole shebang. The file. Delete it. Then restart.

I take it back. It does work! I had disabled MariaDB and then restarted. But I overlooked a setting somewhere or I had to uninstall rather than just disable.

After uninstalling MariaDB and restarting, a new database was created.

Can MariaDB impact the recorder.purge? Because that was not fully purging either. That’s why I dropped via phpMyAdmin and deleted the file in the first place.

Ah, well if you read my post I did say:

You are not. You are using MariaDB.

I thouhgt I had switched back when I disabled MariaDB :slight_smile:
At that point it should have been default again :slight_smile:

Indeed it should…

As long as you changed your recorder: config as well.

e.g. mine is currently:

recorder: !include recorder.yaml

That file contains a MariaDB url and a bunch of exclusions.

To switch back to using the default DB I would have to change this to:

recorder: 

Yes, I might have deleted that entry and forgot to reboot.

Now I just need to get MariaDB back up and running. Everytime I want to use !secrets I get the error message
Failed to save add-on configuration, Missing option 'logins' in root in MariaDB (core_mariadb). Got {'databases': ['homeassistant']}

It was much easier when this was all yaml and you could simply insert the yaml and reboot.