Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Migrate Database Structure As Needed #83

Closed
dklinkman opened this issue Oct 6, 2020 · 5 comments · Fixed by #222
Closed

[FEAT] Migrate Database Structure As Needed #83

dklinkman opened this issue Oct 6, 2020 · 5 comments · Fixed by #222
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@dklinkman
Copy link

Is your feature request related to a problem? Please describe.
Not a problem really, but when a scrutiny docker container is recreated the collected smart drive information and presumably history metrics are lost. I worked around this by creating a persistent volume for /scrutiny/config.

Describe the solution you'd like
Will the structure of scrutiny.db remain constant over time and future versions of scrutiny? Or is the structure likely to evolve with the tool, meaning a persisted database may not work with a future version? Depending on the answers a feature request might be an ability to [automagically] migrate the database to a new version, if necessary, when a container is recreated with a newer version of scrutiny.

@dklinkman dklinkman changed the title [FEAT] [FEAT] Migrate Database Structure As Needed Oct 6, 2020
PrplHaz4 added a commit to PrplHaz4/scrutiny that referenced this issue Oct 6, 2020
The only difference between this and the `docker run` from the main page is I've added a persistent volume for the database.

related AnalogJ#6, AnalogJ#83
@shamoon
Copy link
Contributor

shamoon commented Oct 6, 2020

Yea +1 this, watchtower update last night and my stats were all wiped...

@AnalogJ
Copy link
Owner

AnalogJ commented Oct 8, 2020

Yeah, a volume/bind mount is required to persist the container data between restarts.

Initially I didn't include it in the README docker command because I was constantly making breaking changes to the DB schema, but it's pretty stable now. DB schema automigration is already enabled in the ORM I'm using, though it's not as robust as I'd like.

@AnalogJ AnalogJ added enhancement New feature or request good first issue Good for newcomers labels Oct 8, 2020
@joe-eklund
Copy link

Ah I was looking for how to get my database to persist. I am currently mounting the scrutiny/config folder to a local disk, so that it will persist between container restarts. That way I can keep my history. Seems to be working fine.

Would you say this is acceptable for now? Or are there database breaking changes coming you think? @AnalogJ

Another question, have you thought about using another docker image as the database (like mariadb/postgres)?

@AnalogJ
Copy link
Owner

AnalogJ commented Apr 25, 2021

Yeah thats probably the best way to do this for now @joe-eklund, eventually I'll probably have to move to InfluxDB, but I'll make sure there's a built in migration tool for existing data.

@AnalogJ
Copy link
Owner

AnalogJ commented Apr 25, 2021

Adding support for an external database is definitely on my to-do list. I use an ORM for structured data, which can be configured for multiple database types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants