Running Piwik 1.7 I discovered that the stats from site.domain.com was actually being tracked as site2.domain.com because the wrong tracking code was attached to the actual site.
I figured that I could fix this in the database by running a few queries, so I ran these queries on a copy of the database:
update `piwik_archive_numeric_2012_02`
set idsite = 23
where idsite = 22
update `piwik_archive_blob_2012_02`
set idsite = 23
where idsite = 22
update `piwik_log_visit`
set idsite = 23
where idsite = 22
I also ran the archive.php script after this.
While the site2.domain.com was empty with zero visits after these queries, site.domain.com (id 23) actually lost visits according to the Piwik admin interface. What did I do wrong or miss?
Sorry, I meant piwik_site then update the ts_created field using phpmyadmin for example.
Then delete all archive tables,
run the cron script or access UI
it should work?
Thanks! I first updated to 1.7.1 before doing anything.
Then checked that these look as they should, which they seem to do:
[attachment 530 Skrmavbild2012-02-26kl.18.37.58.png]
Then I deleted all piwik_archive_* tables.
Then I set Piwik settings Allow Piwik archiving to trigger when reports are viewed from the browser to Yes.
Then I clicked on the Piwik logo to go to the front page. I reloaded the database tables and saw four new piwik_archive_* tables, only tables for *_2012_01 and *_2012_02, nothing for 2011.
The end result: The changes for site #1 to site #2 got through and all visits that was erroneously collected/reported is now visible for the right site. However, one problem still exists: Logs from before january are missing.
I think we got everything now (not entirely confident though, but what we have will do). However… There is a related problem with displaying the archived data where some archived visits are only visible if I select date range or a specific day, all other display options hide the visits. Look at this video for an example: Private video on Vimeo (use password piwik).