Migrating Apache2 Log Files

Migrating Apache2 Log Files

I got my second wind after successfully migrating the WordPress website and got to thinking about moving all the log files. I plan to keep all the stats I accumulated under the old domain and continue forward.

After several failed attempts at migrating Webalizer I gave up and decided to look for  a more up to date log analyzer. I quickly found out my first choice, the “GoAccess” log analyzer, would not work for my purposes, so I started looking for something else and came across “AWStats”.

Moving On From Webalizer

Webalizer is like a trusted old friend. Webalizer has been running here for so long, I wondered how I’d ever get along without it. One look at AWStats and I was ready to switch. It makes Webalizer look like something from the Flintstones!


I was successful in transferring the log files from the old domain to the new domain. I was able to work it out after reading this article and combining it with ideas presented in a second article.

Steps taken:

  1. Delete all existing files in the AWStats DataDir  ‘/var/lib/awstats’
  2. Combine all my log files using the utility “logresolvemerge.pl” into one ‘masterlog’ file.
  3. Temporarily modify awstats.conf to update from the ‘masterlog’ file.
  4. Run the update.

Voila! The previous years logs were successfully imported into AWStats!

Next, I went back to the ‘awstats.conf’ file and set it to back to read the daily Apache2 access.log file

Log File / Domain Overlap

The Apache server is still running on the old domain. I can see there are still some connections to it, so I put a redirect on the entry page, and another redirect on my other high traffic page.

Using redirects, we can ensure all clients using outdated bookmarks will be taken to the same page on the new server.

After this, the only connections I should see should be direct connections to old domain URL’s from stale bookmarks.

I plan to let the Apache servers overlap in operation for the remainder of the month of December (2018 for that matter). On January 1, 2019 I will take the old Apache server offline for good. By that time all the search engines should have my entire site indexed, and I hope to have AWStats completely tweaked out by then.

Back To The Front

Author: K6HR

Licensed since 1994. Active on HF / VHF / UHF / Satellite.

Leave a Reply