What's new

vnStat how to restore vnstat database

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

slytho

Regular Contributor
Hi!

I have a recent backup of the jffs partition (tar archive). I need to restore the vnstat database from it (no configuration or settings, only the database). Which files and folders do I have to extract from the tar file to the dn-vnstat.d folder?

Is it simply the complete folder "csv"?

Best regards!
 
Last edited:
Omg o_O

I just found out: The vnstat db is located in /opt/var/lib/vnstat/? Really? 💩 Why?? It seems to be out of scope of any backup routines.

How can history data from dn-vnstat.d/csv/dn-vnstatdata.csv be restored into vnstat's SQL-db in /opt/var/lib/vnstat/?
 
Last edited:
/opt is soft linked to the entware directory on the USB drive.
That's a mere tech description only. Not helpful for the enduser. 🤷‍♂️

There's no real hint anywhere as far as I know. Neither vnstat's config menu nor the board's webpage for vnstat nor the router's vnstat page tell something about the database and how to make sure to back it up in the right way. I've just found the db's location by reading the vnstat script. Common users would rather expect their data being backed up when using the router's JFFS partition backup tool. And yes, of course, "It's the whole partition with all data in it, right?!" And even if some doubt it and actually take a look in the folders to be sure (what most ppl won't do), they'll find something like "csv" and a zip file in the jffs partition with history data, accompanied with vnstat's settings data in the same place and hence they'll believe: yup, that's the data's storage location they need to back up. But it is not. That's just temporary data, not the actual db. And yes, when uninstalling vnstat it certainly asks though if settings and data should be kept ... but that doesn't help. How should they know there are two distinct storage locations and they maybe backuped the wrong one?

I mean wouldn't it be an improvement to have something like an import/export data setting for vnstat (including settings and db data) and some short but clear hints/instructions on the vnstat setting's page on how to save ALL vnstat data? No big deal to implement, but a win of positive user experience.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top