Closed agneevX closed 2 years ago
There's no vnstat2
from my side being released so I have to assume that you are referring to how some distribution has done the binary packaging and instead of continuing with vnstat
they've opted to branch to vnstat2
when vnStat 2.0 was released in October 2018.
vnStat supports keeping all the data when upgrading from version 1.x to version 2.x. The only requirement is that the old database files from version 1.x are kept in the same database directory as version 2.x is configured to be using during the first startup of the daemon (vnstatd
). If the version 2.x daemon doesn't find the new format database in the directory but finds old format databases then it will proceed in importing all the data to the new format, reconstruct "yearly" data from what's available and leave the old database files untouched. Any later restart when the new format database already exists will no longer result in the import being executed and the old database files can be removed from the directory as a result.
It may help to also check the change notes starting from the release you are currently using: https://github.com/vergoh/vnstat/blob/master/CHANGES There's also a list of new configuration options per release available: https://github.com/vergoh/vnstat/blob/master/UPGRADE.md
Thanks for the info. The migration was done exactly as you said and there have been no issues.
@vergoh is it safe to delete the old files?
# ls -lah /tmp/mnt/sda1/entware/var/lib/vnstat/
drwxr-xr-x 2 root 0 4.0K Dec 30 16:57 .
drwxr-xr-x 4 root 0 4.0K May 18 2021 ..
-rw-r--r-- 1 root 0 2.7K Dec 30 16:52 .ath0
-rw-r--r-- 1 root 0 2.7K Dec 30 16:52 .ath1
-rw-r--r-- 1 root 0 2.7K Dec 30 16:52 .ath2
-rw-r--r-- 1 root 0 2.7K Dec 30 16:52 .eth0
-rw-r----- 1 root 0 2.7K Dec 30 16:52 .eth1
-rw-r--r-- 1 root 0 2.7K Dec 30 16:52 ath0
-rw-r--r-- 1 root 0 2.7K Dec 30 16:52 ath1
-rw-r--r-- 1 root 0 2.7K Dec 30 16:52 ath2
-rw-r--r-- 1 root 0 2.7K Dec 30 16:52 eth0
-rw-r--r-- 1 root 0 2.7K Dec 30 16:52 eth1
-rw-r--r-- 1 root 0 76.0K Dec 30 16:57 vnstat.db
Pasting the logs here in case anyone else stumbles on to this...
Yes, the old files (*th*
) can be deleted. vnstat.db
now contains all the data vnStat 2.x uses regardless of the number of interfaces being monitored.
Hello,
I've been using
vnstat
for a while now, but noticed thatvnstat2
is now available.What's the best way to move the current DBs over, if it can be moved over?
Currently the DBs are stored in
/tmp/mnt/sda1/entware/var/lib/vnstat
folder.Appreciate any help, thanks.