compress database

Mar 30, 2017
Jim Storms wrote
We have been with Vpop for many iterations. Since 2.0. During this time the database has been changed, updated, etc. Also archived after a long period so the database is probably oversized. Is there a way to compress and free up space? Recently had drive go to zero space available, I know my fault for not monitoring, and looking at files sizes I cannot see any taking up that much space.

There are also a few files designated as "old" such as spamfilter.db.old and web_mail_old. One folder I see as 2gb+ is pgsql91_v7upg. Is it needed after conversion to v71?
1 Answer
Mar 31, 2017
Paul Smith agent wrote
There is a file in the VPOP3 directory called 'filestodelete.txt'. That contains a list of files/folders which the installer knows can be deleted if everything is working fine. There may be other files, eg if you have made/copied files manually (that will be what the spamfilter.db.old etc files are).

The VPOP3\_database folder can probably be emptied when VPOP3 is shutdown. VPOP3 needs some files in there, but it will recreate them when it starts if they don't already exist, and they probably won't be as big as the ones you've deleted). If you want to try this, we recommend that you stop VPOP3, rename the _database folder to something else and restart VPOP3. Once you're happy that everything is working fine, then you can delete the old folder.

The pgsql91_v7upg folder can be deleted if everything is working OK - however that won't free much disk space because the files in the 'data\base' folder in there are hard links to the live files in the main pgsql folder so deleting them will just delete the link, not the actual data (which is still in use). (https://msdn.microsoft.com/en-us/library/windows/desktop/aa365006(v=vs.85).aspx)

If you want to really get rid of everything old, then you can stop VPOP3, backup the VPOP3 database, uninstall and delete the entire VPOP3 directory (except the database backup!) and then reinstall using the database backup during the installation. All settings are stored in the database now, so the database backup is everything you need. Obviously there may be considerable downtime while you do this and it's a lot of effort for probably just a few MB of disk space when disk space is so cheap nowadays.