Awstats Historical SSL Stats Not Always Imported when Migrating from cPanel, with My Workaround

SYSTEM INFORMATION
OS type and version Rocky 8.7
Webmin version 2.001
Virtualmin version 7.3 Pro
Related packages Awstats

I’ve encountered this issue a number of times when migrating sites; but for some reason, it doesn’t happen all the time. I think, but am not certain, that the problem only manifests if the site being migrated was accessed by both HTTP and HTTPS at some points in its history.

In other words, the problem will happen when migrating an old site that was served without SSL in its early days, and then switched to forced SSL; but it will not happen if the site either never had SSL, or always had forced SSL.

The problem is that cPanel stores the Awstats files for HTTP and HTTPS separately; and Virtualmin seems to only import the HTTP files during the migration. So if a site switched to forced SSL five years ago, the past five years of Awstats data will be empty after the site is migrated.

Post-migration, the cPanel stats for non-SSL access can be found in

/home/{user}/tmp/awstats

The cPanel stats for SSL access can be found in

/home/{user}/tmp/awstats/ssl

The method I’ve been using to work around this has been to copy all the

awstatsxxxxxx.example.tld.txt

files from

/home/{user}/tmp/awstats/ssl

to

/home/{user}/awstats,

then manually run the cron job to update Awstats. Voila. There are the historical stats.

I won’t say that this is the “right” way to do it. It’s just what I’ve been doing when it happens, and it seems to work.

Richard

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.