HowTo Backup Statistics

dietmar

Proxmox Staff Member
Staff member
Apr 28, 2005
17,270
680
213
Austria
www.proxmox.com
The normal Proxmox Backup does not include the mail statistics, becaues they can be quite large on high volume sites. Instead the backup only includes the configuration data.

But it is posible to backup/restore the statistics on the console. The statistics are stored in the "Proxmox_ruledb" SQL Database (postgres). You just need to backup/restore the two tables 'statistic' and 'receivers':

1.) Login via ssh
2.) Dump the Statistics to a file (data.sql)

Code:
> pg_dump -U postgres -d Proxmox_ruledb -t receivers >data.sql
> pg_dump -U postgres -d Proxmox_ruledb -t statistic >>data.sql

3.) You can restore that file later if you need it

IMPORTANT: Please stop the Proxmox Filter and Policy services first

Code:
> echo "DROP TABLE receivers;DROP TABLE statistic;"| psql -U postgres -d Proxmox_ruledb
> psql -U postgres -d Proxmox_ruledb <data.sql

Restart the Services
 
see the admin guide (chapter "Backup considerations"), there is an easy way to backup statistics.
 
Last edited:
I've just done a test restore of backup file onto a test proxmox box. It's restored the settings etc - but not the stats.

Any ideas?

thanks,
Peter.
 
I've just done a test restore of backup file onto a test proxmox box. It's restored the settings etc - but not the stats.

Any ideas?

thanks,
Peter.

see admin guide for details.

backups via web interface does not include stats. only scheduled backups or commandline backups include the stats.

restore via web interface does not restore stats.
you need to restore via commandline with the right options.