diff --git a/misc/cron/archive.php b/misc/cron/archive.php
index 79a8c1857c12e82cedc0f0ac4e223eb1cb0cf263..b7885878b1aa6193d4e00a0e9b1fa0cd72c368f5 100644
--- a/misc/cron/archive.php
+++ b/misc/cron/archive.php
@@ -188,6 +188,7 @@ class Archiving
 		$this->logSection("START");
 		$this->log("Starting Piwik reports archiving...");
 		
+		$this->websites = array_unique($this->websites);
 		foreach ($this->websites as $idsite) 
 		{
 			flush();
@@ -222,7 +223,7 @@ class Archiving
 		    	$shouldArchivePeriods = true;
 		    }
 		    
-		    // If the website is archived because it is a new day in its timezone
+		    // (*) If the website is archived because it is a new day in its timezone
 		    // We make sure all periods are archived, even if there is 0 visit today
 		    if(!$shouldArchivePeriods
 		    	&& in_array($idsite, $this->websiteDayHasFinishedSinceLastRun))
@@ -230,6 +231,14 @@ class Archiving
 		    	$shouldArchivePeriods = true;
 		    }
 		    
+		    // (*) If there was some old reports invalidated for this website
+		    // we make sure all these old reports are triggered at least once
+		    $websiteIsOldDataInvalidate = in_array($idsite, $this->idSitesInvalidatedOldReports);
+		    if($websiteIsOldDataInvalidate)
+		    {
+		    	$shouldArchivePeriods = true;
+		    }
+		    
 		    // Test if we should process this website at all
 		    $elapsedSinceLastArchiving = time() - $lastTimestampWebsiteProcessedDay;
 		    if(!$shouldArchivePeriods
@@ -247,9 +256,16 @@ class Archiving
 		    // running do not grab the same website from the queue
 		    Piwik_SetOption( $this->lastRunKey($idsite, "day"), time() );
 		    
-		    $url = $this->getVisitsRequestUrl($idsite, "day", 
-							    // when --force-all-websites option, also forces to archive last52 days to be safe
-							$this->shouldArchiveAllWebsites ? false : $lastTimestampWebsiteProcessedDay);
+		    $url = $this->getVisitsRequestUrl($idsite, "day",
+			    				// when some data was purged from this website
+			    				// we make sure we query all previous days/weeks/months
+		    				$websiteIsOldDataInvalidate
+								// when --force-all-websites option, 
+								// also forces to archive last52 days to be safe
+							|| $this->shouldArchiveAllWebsites 
+								? false 
+								: $lastTimestampWebsiteProcessedDay
+			);
 		    $content = $this->request($url);
 		    $response = @unserialize($content);
 		    
@@ -302,6 +318,24 @@ class Archiving
 				if($success)
 				{
 					Piwik_SetOption( $this->lastRunKey($idsite, "periods"), time() );
+					
+					// Remove this website from the list of websites to be invalidated
+					// since it now just been re-processing the reports, job is done!
+					if( in_array($idsite, $this->idSitesInvalidatedOldReports ) )
+					{
+						$websiteIdsInvalidated = Piwik_CoreAdminHome_API::getWebsiteIdsToInvalidate();
+						
+						if(count($websiteIdsInvalidated))
+						{
+							$found = array_search($idsite, $websiteIdsInvalidated);
+							if($found!==false)
+							{
+								unset($websiteIdsInvalidated[$found]);
+//								$this->log("Websites left to invalidate: " . implode(", ", $websiteIdsInvalidated));
+								Piwik_SetOption(Piwik_CoreAdminHome_API::OPTION_INVALIDATED_IDSITES, serialize($websiteIdsInvalidated));
+							}
+						}
+					}
 				}
 				$archivedPeriodsArchivesWebsite++;
 			}
@@ -685,8 +719,20 @@ class Archiving
 							. $prettySeconds 
 							. " " 
 							. $websiteIds);
+							
+			// 2) All websites that had reports in the past invalidated recently
+			//	eg. when using Python log import script
+			$this->idSitesInvalidatedOldReports = Piwik_CoreAdminHome_API::getWebsiteIdsToInvalidate();
+			$this->idSitesInvalidatedOldReports = array_intersect($this->idSitesInvalidatedOldReports, $this->allWebsites);
+			
+			if(count($this->idSitesInvalidatedOldReports) > 0)
+			{
+				$websiteIds = ", IDs: ".implode(", ", $this->idSitesInvalidatedOldReports);
+				$this->log("Will process ". count($this->idSitesInvalidatedOldReports). " other websites because some old data reports have been invalidated (eg. using the Log Import script) " . $websiteIds);
+				$this->websites = array_merge($this->websites, $this->idSitesInvalidatedOldReports);
+			}
 			
-			// 2) Also process all other websites which days have finished since the last run.
+			// 3) Also process all other websites which days have finished since the last run.
 			//    This ensures we process the previous day/week/month/year that just finished, even if there was no new visit
 			$uniqueTimezones = Piwik_SitesManager_API::getInstance()->getUniqueSiteTimezones();
 			$timezoneToProcess = array();
@@ -700,6 +746,7 @@ class Archiving
 					$timezoneToProcess[] = $timezone;
 				}
 			}
+			
 			$websiteDayHasFinishedSinceLastRun = Piwik_SitesManager_API::getInstance()->getSitesIdFromTimezones($timezoneToProcess);
 			$websiteDayHasFinishedSinceLastRun = array_diff($websiteDayHasFinishedSinceLastRun, $this->websites);
 			$this->websiteDayHasFinishedSinceLastRun = $websiteDayHasFinishedSinceLastRun;
@@ -709,7 +756,9 @@ class Archiving
 				$this->log("Will process ". count($websiteDayHasFinishedSinceLastRun). " other websites because the last time they were archived was on a different day (in the website's timezone) " . $websiteIds);
 				
 				$this->websites = array_merge($this->websites, $websiteDayHasFinishedSinceLastRun);
-			}	
+			}
+
+			
 		}
 	}
 
diff --git a/plugins/CoreAdminHome/API.php b/plugins/CoreAdminHome/API.php
index a4910801f950850aaaa50b53f5c1013433eca241..acce80a5d49b0d53e5c11c4f0fedb33b4dfa14d8 100644
--- a/plugins/CoreAdminHome/API.php
+++ b/plugins/CoreAdminHome/API.php
@@ -43,4 +43,195 @@ class Piwik_CoreAdminHome_API
 		Piwik::checkUserIsSuperUser();
 		return Piwik::getKnownSegmentsToArchive();
 	}
+
+	/*
+	 * stores the list of websites IDs to re-reprocess in archive.php 
+	 */
+	const OPTION_INVALIDATED_IDSITES = 'InvalidatedOldReports_WebsiteIds';
+	
+	/**
+	 * When tracking data in the past (using Tracking API), this function
+	 * can be used to invalidate reports for the idSites and dates where new data
+	 * was added. 
+	 * DEV: If you call this API, the UI should display the data correctly, but will process
+	 *      in real time, which could be very slow after large data imports. 
+	 *      After calling this function via REST, you can manually force all data 
+	 *      to be reprocessed by visiting the script as the Super User:
+	 *      http://example.net/piwik/misc/cron/archive.php?token_auth=$SUPER_USER_TOKEN_AUTH_HERE 
+	 * REQUIREMENTS: On large piwik setups, you will need in PHP configuration: max_execution_time = 0
+	 * 	We recommend to use an hourly schedule of the script at misc/cron/archive.php 
+	 * 	More information: http://piwik.org/setup-auto-archiving/
+	 * 
+	 * @param string $idSites Comma separated list of idSite that have had data imported for the specified dates
+	 * @param string $dates Comma separated list of dates to invalidate for all these websites
+	 */
+	public function invalidateArchivedReports($idSites, $dates)
+	{
+		Piwik::checkUserIsSuperUser();
+		$idSites = Piwik_Site::getIdSitesFromIdSitesString($idSites);
+		// Ensure the specified dates are valid
+		$toInvalidate = $invalidDates = array();
+		$dates = explode(',', $dates);
+		$dates = array_unique($dates);
+		foreach($dates as $theDate)
+		{
+			try {
+				$date = Piwik_Date::factory($theDate);
+			} catch(Exception $e) {
+				$invalidDates[] = $theDate;
+				continue;
+			}
+			if($date->toString() == $theDate)
+			{
+				$toInvalidate[] = $date;
+			}
+			else
+			{
+				$invalidDates[] = $theDate;
+			}
+		}
+
+		// Lookup archive tables
+		$tables = Piwik::getTablesInstalled();
+		$archiveTables = array();
+		foreach($tables as $table)
+		{
+			if(strpos($table, 'archive_') !== false)
+			{
+				$archiveTables[] = $table;
+			}
+		}
+
+		
+		// If using the feature "Delete logs older than N days"...
+		$logsAreDeletedBeforeThisDate = Piwik_Config::getInstance()->Deletelogs['delete_logs_schedule_lowest_interval'];
+		$logsDeleteEnabled = Piwik_Config::getInstance()->Deletelogs['delete_logs_enable'];
+		$minimumDateWithLogs = false;
+		if($logsDeleteEnabled
+			&& $logsAreDeletedBeforeThisDate) 
+		{
+			$minimumDateWithLogs = Piwik_Date::factory('today')->subDay($logsAreDeletedBeforeThisDate);
+		}
+			
+		// Given the list of dates, process which tables they should be deleted from
+		$minDate = false;
+		$warningDates = $processedDates = array();
+		/* @var $date Piwik_Date */
+		foreach($toInvalidate as $date)
+		{
+			// we should only delete reports for dates that are more recent than N days
+			if($minimumDateWithLogs
+				&& $date->isEarlier($minimumDateWithLogs))
+			{
+				$warningDates[] = $date->toString();
+			}
+			else
+			{
+				$processedDates[] = $date->toString();
+			}
+				
+			$month = $date->toString('Y_m');
+			// For a given date, we must invalidate in the monthly archive table
+			$datesByMonth[$month][] = $date->toString();
+			
+			// But also the year stored in January
+			$year = $date->toString('Y_01');
+			$datesByMonth[$year][] = $date->toString();
+			
+			// but also weeks overlapping several months stored in the month where the week is starting
+			/* @var $week Piwik_Period_Week */
+			$week = Piwik_Period::factory('week', $date);
+			$week = $week->getDateStart()->toString('Y_m');
+			$datesByMonth[$week][] = $date->toString();
+			
+			// Keep track of the minimum date for each website 
+			if($minDate === false
+				|| $date->isEarlier($minDate))
+			{
+				$minDate = $date;
+			}
+		}
+		
+		// In each table, invalidate day/week/month/year containing this date
+		$sqlIdSites = implode(",", $idSites);
+		foreach($archiveTables as $table)
+		{
+			// Extract Y_m from table name
+			$suffix = str_replace(array('archive_numeric_','archive_blob_'), '', Piwik_Common::unprefixTable($table));
+			
+			if(!isset($datesByMonth[$suffix]))
+			{
+				continue;
+			}
+			// Dates which are to be deleted from this table
+			$datesToDeleteInTable = $datesByMonth[$suffix];
+			
+			// Build one statement to delete all dates from the given table
+			$sql = $bind = array();
+			$datesToDeleteInTable = array_unique($datesToDeleteInTable);
+			foreach($datesToDeleteInTable as $dateToDelete)
+			{
+				$sql[] = '(date1 <= ? AND ? <= date2)';
+				$bind[] = $dateToDelete;
+				$bind[] = $dateToDelete;
+			}
+			$sql = implode(" OR ", $sql);
+			
+			$query = "DELETE FROM $table ".
+					" WHERE ( $sql ) ". 
+					" AND idsite IN (". $sqlIdSites .")";
+			Piwik_Query($query, $bind);
+			var_dump($query);var_dump($bind);
+		}
+
+		// Update piwik_site.ts_created 
+		$query = "UPDATE " . Piwik_Common::prefixTable("site") .
+				" SET ts_created = ?".
+				" WHERE idsite IN ( $sqlIdSites )
+					AND ts_created > ?";
+		$minDateSql = $minDate->subDay(1)->getDatetime();
+		$bind = array($minDateSql,$minDateSql);
+		Piwik_Query($query, $bind);
+//		var_dump($query);var_dump($bind);
+
+		// Force to re-process data for these websites in the next archive.php cron run
+		$invalidatedIdSites = Piwik_CoreAdminHome_API::getWebsiteIdsToInvalidate();
+		$invalidatedIdSites = array_merge($invalidatedIdSites, $idSites);
+		$invalidatedIdSites = array_unique($invalidatedIdSites);
+		$invalidatedIdSites = array_values($invalidatedIdSites);
+		Piwik_SetOption(self::OPTION_INVALIDATED_IDSITES, serialize($invalidatedIdSites));
+		
+		Piwik_Site::clearCache();
+		
+		$output = array();
+		// output logs
+		if($warningDates)
+		{
+			$output[] = 'Warning: the following Dates have not been invalidated, because they are earlier than your Log Deletion limit: '.
+						implode(", ", $warningDates).
+					"\n The last day with logs is " . $minimumDateWithLogs. ". ".
+					"\n Please disable this feature or set it to a higher deletion threshold (eg. 180 days or 365 years).'.";
+		} 
+		$output[] = "Success. The following dates were invalidated successfully: ".
+						implode(", ", $processedDates);
+		return $output;
+	}
+	
+	/**
+	 * Returns array of idSites to force re-process next time archive.php runs
+	 * 
+	 * @ignore
+	 */
+	static public function getWebsiteIdsToInvalidate()
+	{
+		Piwik::checkUserIsSuperUser();
+		$invalidatedIdSites = Piwik_GetOption(self::OPTION_INVALIDATED_IDSITES);
+		if($invalidatedIdSites 
+			&& ($invalidatedIdSites = unserialize($invalidatedIdSites))
+			&& count($invalidatedIdSites))
+		{
+			return $invalidatedIdSites;
+		}
+		return array();
+	}
 }
diff --git a/tests/integration/Integration.php b/tests/integration/Integration.php
index 24c7992d127183d5bb4f6b2c6d39609a9f7e6466..f1a668d86da0a867196c20ab81411908c3ef388b 100644
--- a/tests/integration/Integration.php
+++ b/tests/integration/Integration.php
@@ -416,13 +416,18 @@ abstract class Test_Integration extends Test_Database_Base
 					$parametersToSet['period'] = $period;
 
 					// If date must be a date range, we process this date range by adding 6 periods to it
-					if($setDateLastN === true)
+					if($setDateLastN)
 					{
 						if(!isset($parametersToSet['dateRewriteBackup']))
 						{
 							$parametersToSet['dateRewriteBackup'] = $parametersToSet['date'];
 						}
-						$lastCount = 6;
+						
+						$lastCount = (int)$setDateLastN;
+						if($setDateLastN === true)
+						{
+							$lastCount = 6;
+						}
 						$firstDate = $parametersToSet['dateRewriteBackup'];
 						$secondDate = date('Y-m-d', strtotime("+$lastCount " . $period . "s", strtotime($firstDate)));
 						$parametersToSet['date'] = $firstDate . ',' . $secondDate;
@@ -1071,6 +1076,18 @@ abstract class Test_Integration_Facade extends Test_Integration
 	abstract public function getApiToTest();
 
 	/**
+     * It is possible to run another set of API tests after the first one.
+     * For example, getApiToTest() will test and record with a specific suffix
+     * Then we will call some API that invalidates a piece of the reports
+     * Then call all reports again and check that what is expected to have changed indeed has changed!
+     * 
+     * @see getApiToTest() for returned values, same signature
+	 */
+	public function getAnotherApiToTest()
+	{
+		return array();
+	}
+	/**
 	 * Returns an array describing the Controller actions to call & compare
 	 * with expected output.
 	 *
@@ -1114,6 +1131,7 @@ abstract class Test_Integration_Facade extends Test_Integration
 
 		$this->runApiTests();
 		$this->runControllerTests();
+		$this->runApiAnotherTests();
 	}
 
 	/**
@@ -1124,12 +1142,27 @@ abstract class Test_Integration_Facade extends Test_Integration
 		return str_replace('Test_Piwik_Integration_', '', get_class($this));
 	}
 
+	/*
+	 * When there 2 distinct sets of APIs to call, call it
+	 */
+	private function runApiAnotherTests()
+	{
+		$apiToTest = $this->getAnotherApiToTest();
+		if(!empty($apiToTest))
+		{
+			$this->runApiTests( $apiToTest );
+		}
+	}
+	
 	/**
 	 * Runs API tests.
 	 */
-	private function runApiTests()
+	private function runApiTests($apiToTest = false)
 	{
-		$apiToTest = $this->getApiToTest();
+		if($apiToTest === false)
+		{
+			$apiToTest = $this->getApiToTest();
+		}
 		$testName = 'test_' . $this->getOutputPrefix();
 
 		foreach ($apiToTest as $test)
diff --git a/tests/integration/VisitsInPast_InvalidateOldReports.test.php b/tests/integration/VisitsInPast_InvalidateOldReports.test.php
new file mode 100644
index 0000000000000000000000000000000000000000..54f2983c9f709316915042ca10f2c6e20c6a5292
--- /dev/null
+++ b/tests/integration/VisitsInPast_InvalidateOldReports.test.php
@@ -0,0 +1,164 @@
+<?php
+if(!defined('PIWIK_CONFIG_TEST_INCLUDED'))
+{
+	require_once dirname(__FILE__)."/../../tests/config_test.php";
+}
+
+require_once PIWIK_INCLUDE_PATH . '/tests/integration/Integration.php';
+
+/**
+ * 
+ */
+class Test_Piwik_Integration_VisitsInPast_InvalidateOldReports extends Test_Integration_Facade
+{
+	protected $dateTimeFirstDateWebsite1 = '2010-03-06 01:22:33';
+	protected $dateTimeDateInPastWebsite1 = '2010-01-06 01:22:33';
+	
+	protected $dateTimeFirstDateWebsite2 = '2010-01-03 20:22:33';
+	protected $dateTimeDateInPastWebsite2 = '2009-10-30 01:22:33';
+	protected $idSite = null;
+	protected $idSite2 = null;
+	
+	/**
+	 * This should NOT return data for old dates before website creation
+	 */
+	public function getApiToTest()
+	{
+		// We test a typical Numeric and a Recursive blob reports
+    	$apiToCall = array('VisitsSummary.get', 'Actions.getPageUrls');
+		
+		// We also test a segment 
+		//TODO
+		
+    	// Build tests for the 2 websites
+    	$test = array($apiToCall, array('idSite' => $this->idSite, 
+    			'testSuffix' => 'Website'.$this->idSite.'_OldReportsShouldNotAppear',
+    			'date' => $this->dateTimeDateInPastWebsite1,
+    			'periods' => 'month',
+    			'setDateLastN' => 4, // 4months ahead
+ 				'otherRequestParameters' => array('expanded' => 1)));
+    	$testWebsite2 = $test;
+    	$testWebsite2[1]['idSite'] = $this->idSite2;
+    	$testWebsite2[1]['testSuffix'] = 'Website'.$this->idSite2.'_OldReportsShouldNotAppear';
+    	$testWebsite2[1]['date'] = $this->dateTimeDateInPastWebsite2;
+    	
+		$this->tests = array(
+			$test,
+			$testWebsite2
+		);
+		return $this->tests;
+	}
+	
+	/**
+	 * This is called after getApiToTest()
+	 * WE invalidate old reports and check that data is now returned for old dates
+	 */
+	public function getAnotherApiToTest()
+	{
+		// 1) Invalidate old reports for the 2 websites
+		// Test invalidate 1 date only
+		$r = new Piwik_API_Request("module=API&method=CoreAdminHome.invalidateArchivedReports
+			&idSites=4,5,6,55,-1,s',1&dates=2010-01-03");
+		($r->process());
+		// Test invalidate comma separated dates
+		$r = new Piwik_API_Request("module=API&method=CoreAdminHome.invalidateArchivedReports
+			&idSites=".$this->idSite.",".$this->idSite2."&dates=2010-01-06,2009-10-30");
+		($r->process());
+		// test invalidate date in the past
+		$r = new Piwik_API_Request("module=API&method=CoreAdminHome.invalidateArchivedReports
+			&idSites=".$this->idSite2."&dates=2009-06-29");
+		($r->process());
+		// invalidate a date more recent to check the date is only updated when it's earlier than current
+		$r = new Piwik_API_Request("module=API&method=CoreAdminHome.invalidateArchivedReports
+			&idSites=".$this->idSite2."&dates=2010-03-03");
+		($r->process());
+		
+		// 2) Call API again, with an older date, which should now return data
+		// website 1
+    	$this->tests[0][1]['testSuffix'] = 'Website'.$this->idSite.'_OldReportsShouldAppear';
+    	// website2
+    	$this->tests[1][1]['testSuffix'] = 'Website'.$this->idSite2.'_OldReportsShouldAppear';
+
+    	return $this->tests;
+	}
+
+	public function getControllerActionsToTest()
+	{
+		return array();
+	}
+	
+	public function getOutputPrefix()
+	{
+		return 'VisitsInPast_InvalidateOldReports';
+	}
+	
+	public function setUp()
+	{
+		parent::setUp();
+		
+		// Create 2 websites
+		$this->idSite = $this->createWebsite($this->dateTimeFirstDateWebsite1);
+		$this->idSite2 = $this->createWebsite($this->dateTimeFirstDateWebsite2);
+	}
+
+	protected function trackVisits()
+	{
+    	/** 
+    	 * Track Visits normal date for the 2 websites
+    	 */
+		
+		// WEBSITE 1
+    	$t = $this->getTracker($this->idSite, $this->dateTimeFirstDateWebsite1, $defaultInit = true);
+        $t->setUrl( 'http://example.org/category/Page1');
+        $this->checkResponse($t->doTrackPageView( 'Hello'));
+        $t->setUrl( 'http://example.org/category/Page2');
+        $this->checkResponse($t->doTrackPageView( 'Hello'));
+        $t->setUrl( 'http://example.org/category/Page3');
+        $this->checkResponse($t->doTrackPageView( 'Hello'));
+        $t->setUrl( 'http://example.org/Home');
+        $this->checkResponse($t->doTrackPageView( 'Hello'));
+        $t->setUrl( 'http://example.org/Contact');
+        $this->checkResponse($t->doTrackPageView( 'Hello'));
+        $t->setUrl( 'http://example.org/Contact/ThankYou');
+        $this->checkResponse($t->doTrackPageView( 'Hello'));
+        
+		// WEBSITE 2
+    	$t = $this->getTracker($this->idSite2, $this->dateTimeFirstDateWebsite2, $defaultInit = true);
+		$t->setIp('156.15.13.12');
+        $t->setUrl( 'http://example.org/category/Page1');
+        $this->checkResponse($t->doTrackPageView( 'Hello'));
+        $t->setUrl( 'http://example.org/category/Page2');
+        $this->checkResponse($t->doTrackPageView( 'Hello'));
+        $t->setUrl( 'http://example.org/category/Page3');
+        $this->checkResponse($t->doTrackPageView( 'Hello'));
+        $t->setUrl( 'http://example.org/Home');
+        $this->checkResponse($t->doTrackPageView( 'Hello'));
+        $t->setUrl( 'http://example.org/Contact');
+        $this->checkResponse($t->doTrackPageView( 'Hello'));
+        $t->setUrl( 'http://example.org/Contact/ThankYou');
+        $this->checkResponse($t->doTrackPageView( 'Hello'));
+        
+    	/**
+    	 * Track visits in the past (before website creation date) for the 2 websites
+    	 */
+    	// WEBSITE1 
+        $t = $this->getTracker($this->idSite, $this->dateTimeDateInPastWebsite1, $defaultInit = true);
+		$t->setIp('156.5.55.2');
+        $t->setUrl( 'http://example.org/category/Page1');
+        $this->checkResponse($t->doTrackPageView( 'Hello'));
+        $t->setUrl( 'http://example.org/category/Page2');
+        $this->checkResponse($t->doTrackPageView( 'Hello'));
+        $t->setUrl( 'http://example.org/category/Page3');
+        
+    	// WEBSITE2
+    	$t = $this->getTracker($this->idSite2, $this->dateTimeDateInPastWebsite2, $defaultInit = true);
+		$t->setIp('156.52.3.22');
+        $t->setUrl( 'http://example.org/category/Page1');
+        $this->checkResponse($t->doTrackPageView( 'Hello'));
+        $t->setUrl( 'http://example.org/category/Page2');
+        $this->checkResponse($t->doTrackPageView( 'Hello'));
+        $t->setUrl( 'http://example.org/category/Page3');
+        
+	}
+}
+
diff --git a/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldAppear__Actions.getPageUrls_month.xml b/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldAppear__Actions.getPageUrls_month.xml
new file mode 100644
index 0000000000000000000000000000000000000000..5d83c47ec963a2b8b11d86946b70122e404a7a96
--- /dev/null
+++ b/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldAppear__Actions.getPageUrls_month.xml
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<results>
+	<result date="2010-01">
+		<row>
+			<label>category</label>
+			<nb_visits>2</nb_visits>
+			<nb_hits>2</nb_hits>
+			<sum_time_spent>0</sum_time_spent>
+			<entry_nb_visits>1</entry_nb_visits>
+			<entry_nb_actions>2</entry_nb_actions>
+			<entry_sum_visit_length>1</entry_sum_visit_length>
+			<entry_bounce_count>0</entry_bounce_count>
+			<exit_nb_visits>1</exit_nb_visits>
+			<avg_time_on_page>0</avg_time_on_page>
+			<bounce_rate>0%</bounce_rate>
+			<exit_rate>50%</exit_rate>
+			<subtable>
+				<row>
+					<label>/Page1</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<entry_nb_visits>1</entry_nb_visits>
+					<entry_nb_actions>2</entry_nb_actions>
+					<entry_sum_visit_length>1</entry_sum_visit_length>
+					<entry_bounce_count>0</entry_bounce_count>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<sum_daily_entry_nb_uniq_visitors>1</sum_daily_entry_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>0%</exit_rate>
+					<url>http://example.org/category/Page1</url>
+				</row>
+				<row>
+					<label>/Page2</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<exit_nb_visits>1</exit_nb_visits>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>100%</exit_rate>
+					<url>http://example.org/category/Page2</url>
+				</row>
+			</subtable>
+		</row>
+	</result>
+	<result date="2010-02" />
+	<result date="2010-03">
+		<row>
+			<label>category</label>
+			<nb_visits>3</nb_visits>
+			<nb_hits>3</nb_hits>
+			<sum_time_spent>0</sum_time_spent>
+			<entry_nb_visits>1</entry_nb_visits>
+			<entry_nb_actions>6</entry_nb_actions>
+			<entry_sum_visit_length>1</entry_sum_visit_length>
+			<entry_bounce_count>0</entry_bounce_count>
+			<avg_time_on_page>0</avg_time_on_page>
+			<bounce_rate>0%</bounce_rate>
+			<exit_rate>0%</exit_rate>
+			<subtable>
+				<row>
+					<label>/Page1</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<entry_nb_visits>1</entry_nb_visits>
+					<entry_nb_actions>6</entry_nb_actions>
+					<entry_sum_visit_length>1</entry_sum_visit_length>
+					<entry_bounce_count>0</entry_bounce_count>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<sum_daily_entry_nb_uniq_visitors>1</sum_daily_entry_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>0%</exit_rate>
+					<url>http://example.org/category/Page1</url>
+				</row>
+				<row>
+					<label>/Page2</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>0%</exit_rate>
+					<url>http://example.org/category/Page2</url>
+				</row>
+				<row>
+					<label>/Page3</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>0%</exit_rate>
+					<url>http://example.org/category/Page3</url>
+				</row>
+			</subtable>
+		</row>
+		<row>
+			<label>/Contact</label>
+			<nb_visits>1</nb_visits>
+			<nb_hits>1</nb_hits>
+			<sum_time_spent>0</sum_time_spent>
+			<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+			<avg_time_on_page>0</avg_time_on_page>
+			<bounce_rate>0%</bounce_rate>
+			<exit_rate>0%</exit_rate>
+			<url>http://example.org/Contact</url>
+		</row>
+		<row>
+			<label>/Home</label>
+			<nb_visits>1</nb_visits>
+			<nb_hits>1</nb_hits>
+			<sum_time_spent>0</sum_time_spent>
+			<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+			<avg_time_on_page>0</avg_time_on_page>
+			<bounce_rate>0%</bounce_rate>
+			<exit_rate>0%</exit_rate>
+			<url>http://example.org/Home</url>
+		</row>
+		<row>
+			<label>Contact</label>
+			<nb_visits>1</nb_visits>
+			<nb_hits>1</nb_hits>
+			<sum_time_spent>0</sum_time_spent>
+			<exit_nb_visits>1</exit_nb_visits>
+			<avg_time_on_page>0</avg_time_on_page>
+			<bounce_rate>0%</bounce_rate>
+			<exit_rate>100%</exit_rate>
+			<subtable>
+				<row>
+					<label>/ThankYou</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<exit_nb_visits>1</exit_nb_visits>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>100%</exit_rate>
+					<url>http://example.org/Contact/ThankYou</url>
+				</row>
+			</subtable>
+		</row>
+	</result>
+	<result date="2010-04" />
+	<result date="2010-05" />
+</results>
\ No newline at end of file
diff --git a/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldAppear__VisitsSummary.get_month.xml b/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldAppear__VisitsSummary.get_month.xml
new file mode 100644
index 0000000000000000000000000000000000000000..75cd6e0df5b9695ae2de1256a1ab57a8b4b380cc
--- /dev/null
+++ b/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldAppear__VisitsSummary.get_month.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<results>
+	<result date="2010-01">
+		<max_actions>2</max_actions>
+		<nb_actions>2</nb_actions>
+		<nb_uniq_visitors>1</nb_uniq_visitors>
+		<nb_visits>1</nb_visits>
+		<sum_visit_length>1</sum_visit_length>
+		<bounce_rate>0%</bounce_rate>
+		<nb_actions_per_visit>2</nb_actions_per_visit>
+		<avg_time_on_site>1</avg_time_on_site>
+	</result>
+	<result date="2010-02" />
+	<result date="2010-03">
+		<max_actions>6</max_actions>
+		<nb_actions>6</nb_actions>
+		<nb_uniq_visitors>1</nb_uniq_visitors>
+		<nb_visits>1</nb_visits>
+		<sum_visit_length>1</sum_visit_length>
+		<bounce_rate>0%</bounce_rate>
+		<nb_actions_per_visit>6</nb_actions_per_visit>
+		<avg_time_on_site>1</avg_time_on_site>
+	</result>
+	<result date="2010-04" />
+	<result date="2010-05" />
+</results>
\ No newline at end of file
diff --git a/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml b/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml
new file mode 100644
index 0000000000000000000000000000000000000000..89eec3fbc3f0db692f48730114a93962664bd1c2
--- /dev/null
+++ b/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<results>
+	<result date="2010-01" />
+	<result date="2010-02" />
+	<result date="2010-03">
+		<row>
+			<label>category</label>
+			<nb_visits>3</nb_visits>
+			<nb_hits>3</nb_hits>
+			<sum_time_spent>0</sum_time_spent>
+			<entry_nb_visits>1</entry_nb_visits>
+			<entry_nb_actions>6</entry_nb_actions>
+			<entry_sum_visit_length>1</entry_sum_visit_length>
+			<entry_bounce_count>0</entry_bounce_count>
+			<avg_time_on_page>0</avg_time_on_page>
+			<bounce_rate>0%</bounce_rate>
+			<exit_rate>0%</exit_rate>
+			<subtable>
+				<row>
+					<label>/Page1</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<entry_nb_visits>1</entry_nb_visits>
+					<entry_nb_actions>6</entry_nb_actions>
+					<entry_sum_visit_length>1</entry_sum_visit_length>
+					<entry_bounce_count>0</entry_bounce_count>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<sum_daily_entry_nb_uniq_visitors>1</sum_daily_entry_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>0%</exit_rate>
+					<url>http://example.org/category/Page1</url>
+				</row>
+				<row>
+					<label>/Page2</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>0%</exit_rate>
+					<url>http://example.org/category/Page2</url>
+				</row>
+				<row>
+					<label>/Page3</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>0%</exit_rate>
+					<url>http://example.org/category/Page3</url>
+				</row>
+			</subtable>
+		</row>
+		<row>
+			<label>/Contact</label>
+			<nb_visits>1</nb_visits>
+			<nb_hits>1</nb_hits>
+			<sum_time_spent>0</sum_time_spent>
+			<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+			<avg_time_on_page>0</avg_time_on_page>
+			<bounce_rate>0%</bounce_rate>
+			<exit_rate>0%</exit_rate>
+			<url>http://example.org/Contact</url>
+		</row>
+		<row>
+			<label>/Home</label>
+			<nb_visits>1</nb_visits>
+			<nb_hits>1</nb_hits>
+			<sum_time_spent>0</sum_time_spent>
+			<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+			<avg_time_on_page>0</avg_time_on_page>
+			<bounce_rate>0%</bounce_rate>
+			<exit_rate>0%</exit_rate>
+			<url>http://example.org/Home</url>
+		</row>
+		<row>
+			<label>Contact</label>
+			<nb_visits>1</nb_visits>
+			<nb_hits>1</nb_hits>
+			<sum_time_spent>0</sum_time_spent>
+			<exit_nb_visits>1</exit_nb_visits>
+			<avg_time_on_page>0</avg_time_on_page>
+			<bounce_rate>0%</bounce_rate>
+			<exit_rate>100%</exit_rate>
+			<subtable>
+				<row>
+					<label>/ThankYou</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<exit_nb_visits>1</exit_nb_visits>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>100%</exit_rate>
+					<url>http://example.org/Contact/ThankYou</url>
+				</row>
+			</subtable>
+		</row>
+	</result>
+	<result date="2010-04" />
+	<result date="2010-05" />
+</results>
\ No newline at end of file
diff --git a/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__VisitsSummary.get_month.xml b/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__VisitsSummary.get_month.xml
new file mode 100644
index 0000000000000000000000000000000000000000..e10145445478d071a3c097b49c071ee6a14c4715
--- /dev/null
+++ b/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__VisitsSummary.get_month.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<results>
+	<result date="2010-01" />
+	<result date="2010-02" />
+	<result date="2010-03">
+		<max_actions>6</max_actions>
+		<nb_actions>6</nb_actions>
+		<nb_uniq_visitors>1</nb_uniq_visitors>
+		<nb_visits>1</nb_visits>
+		<sum_visit_length>1</sum_visit_length>
+		<bounce_rate>0%</bounce_rate>
+		<nb_actions_per_visit>6</nb_actions_per_visit>
+		<avg_time_on_site>1</avg_time_on_site>
+	</result>
+	<result date="2010-04" />
+	<result date="2010-05" />
+</results>
\ No newline at end of file
diff --git a/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldAppear__Actions.getPageUrls_month.xml b/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldAppear__Actions.getPageUrls_month.xml
new file mode 100644
index 0000000000000000000000000000000000000000..c02db2fa04880f0ed0eb50058deb65ec6b2cc133
--- /dev/null
+++ b/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldAppear__Actions.getPageUrls_month.xml
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<results>
+	<result date="2009-10">
+		<row>
+			<label>category</label>
+			<nb_visits>2</nb_visits>
+			<nb_hits>2</nb_hits>
+			<sum_time_spent>0</sum_time_spent>
+			<entry_nb_visits>1</entry_nb_visits>
+			<entry_nb_actions>2</entry_nb_actions>
+			<entry_sum_visit_length>1</entry_sum_visit_length>
+			<entry_bounce_count>0</entry_bounce_count>
+			<exit_nb_visits>1</exit_nb_visits>
+			<avg_time_on_page>0</avg_time_on_page>
+			<bounce_rate>0%</bounce_rate>
+			<exit_rate>50%</exit_rate>
+			<subtable>
+				<row>
+					<label>/Page1</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<entry_nb_visits>1</entry_nb_visits>
+					<entry_nb_actions>6</entry_nb_actions>
+					<entry_sum_visit_length>1</entry_sum_visit_length>
+					<entry_bounce_count>0</entry_bounce_count>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<sum_daily_entry_nb_uniq_visitors>1</sum_daily_entry_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>0%</exit_rate>
+					<url>http://example.org/category/Page1</url>
+				</row>
+				<row>
+					<label>/Page2</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>0%</exit_rate>
+					<url>http://example.org/category/Page2</url>
+				</row>
+				<row>
+					<label>/Page3</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>0%</exit_rate>
+					<url>http://example.org/category/Page3</url>
+				</row>
+			</subtable>
+		</row>
+	</result>
+	<result date="2009-11" />
+	<result date="2009-12" />
+	<result date="2010-01">
+		<row>
+			<label>category</label>
+			<nb_visits>3</nb_visits>
+			<nb_hits>3</nb_hits>
+			<sum_time_spent>0</sum_time_spent>
+			<entry_nb_visits>1</entry_nb_visits>
+			<entry_nb_actions>6</entry_nb_actions>
+			<entry_sum_visit_length>1</entry_sum_visit_length>
+			<entry_bounce_count>0</entry_bounce_count>
+			<avg_time_on_page>0</avg_time_on_page>
+			<bounce_rate>0%</bounce_rate>
+			<exit_rate>0%</exit_rate>
+			<subtable>
+				<row>
+					<label>/Page1</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<entry_nb_visits>1</entry_nb_visits>
+					<entry_nb_actions>6</entry_nb_actions>
+					<entry_sum_visit_length>1</entry_sum_visit_length>
+					<entry_bounce_count>0</entry_bounce_count>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<sum_daily_entry_nb_uniq_visitors>1</sum_daily_entry_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>0%</exit_rate>
+					<url>http://example.org/category/Page1</url>
+				</row>
+				<row>
+					<label>/Page2</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>0%</exit_rate>
+					<url>http://example.org/category/Page2</url>
+				</row>
+				<row>
+					<label>/Page3</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>0%</exit_rate>
+					<url>http://example.org/category/Page3</url>
+				</row>
+			</subtable>
+		</row>
+		<row>
+			<label>/Contact</label>
+			<nb_visits>1</nb_visits>
+			<nb_hits>1</nb_hits>
+			<sum_time_spent>0</sum_time_spent>
+			<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+			<avg_time_on_page>0</avg_time_on_page>
+			<bounce_rate>0%</bounce_rate>
+			<exit_rate>0%</exit_rate>
+			<url>http://example.org/Contact</url>
+		</row>
+		<row>
+			<label>/Home</label>
+			<nb_visits>1</nb_visits>
+			<nb_hits>1</nb_hits>
+			<sum_time_spent>0</sum_time_spent>
+			<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+			<avg_time_on_page>0</avg_time_on_page>
+			<bounce_rate>0%</bounce_rate>
+			<exit_rate>0%</exit_rate>
+			<url>http://example.org/Home</url>
+		</row>
+		<row>
+			<label>Contact</label>
+			<nb_visits>1</nb_visits>
+			<nb_hits>1</nb_hits>
+			<sum_time_spent>0</sum_time_spent>
+			<exit_nb_visits>1</exit_nb_visits>
+			<avg_time_on_page>0</avg_time_on_page>
+			<bounce_rate>0%</bounce_rate>
+			<exit_rate>100%</exit_rate>
+			<subtable>
+				<row>
+					<label>/ThankYou</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<exit_nb_visits>1</exit_nb_visits>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>100%</exit_rate>
+					<url>http://example.org/Contact/ThankYou</url>
+				</row>
+			</subtable>
+		</row>
+	</result>
+	<result date="2010-02" />
+	<result date="2010-03" />
+</results>
\ No newline at end of file
diff --git a/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldAppear__VisitsSummary.get_month.xml b/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldAppear__VisitsSummary.get_month.xml
new file mode 100644
index 0000000000000000000000000000000000000000..1e31a2dc9b46c7bd3beea08cff9c9f441ff41f35
--- /dev/null
+++ b/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldAppear__VisitsSummary.get_month.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<results>
+	<result date="2009-10">
+		<max_actions>2</max_actions>
+		<nb_actions>2</nb_actions>
+		<nb_uniq_visitors>1</nb_uniq_visitors>
+		<nb_visits>1</nb_visits>
+		<sum_visit_length>1</sum_visit_length>
+		<bounce_rate>0%</bounce_rate>
+		<nb_actions_per_visit>2</nb_actions_per_visit>
+		<avg_time_on_site>1</avg_time_on_site>
+	</result>
+	<result date="2009-11" />
+	<result date="2009-12" />
+	<result date="2010-01">
+		<max_actions>6</max_actions>
+		<nb_actions>6</nb_actions>
+		<nb_uniq_visitors>1</nb_uniq_visitors>
+		<nb_visits>1</nb_visits>
+		<sum_visit_length>1</sum_visit_length>
+		<bounce_rate>0%</bounce_rate>
+		<nb_actions_per_visit>6</nb_actions_per_visit>
+		<avg_time_on_site>1</avg_time_on_site>
+	</result>
+	<result date="2010-02" />
+	<result date="2010-03" />
+</results>
\ No newline at end of file
diff --git a/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml b/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml
new file mode 100644
index 0000000000000000000000000000000000000000..aaef3a0ec567cf5687cccc08e4382000c75a35be
--- /dev/null
+++ b/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<results>
+	<result date="2009-10" />
+	<result date="2009-11" />
+	<result date="2009-12" />
+	<result date="2010-01">
+		<row>
+			<label>category</label>
+			<nb_visits>3</nb_visits>
+			<nb_hits>3</nb_hits>
+			<sum_time_spent>0</sum_time_spent>
+			<entry_nb_visits>1</entry_nb_visits>
+			<entry_nb_actions>6</entry_nb_actions>
+			<entry_sum_visit_length>1</entry_sum_visit_length>
+			<entry_bounce_count>0</entry_bounce_count>
+			<avg_time_on_page>0</avg_time_on_page>
+			<bounce_rate>0%</bounce_rate>
+			<exit_rate>0%</exit_rate>
+			<subtable>
+				<row>
+					<label>/Page1</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<entry_nb_visits>1</entry_nb_visits>
+					<entry_nb_actions>6</entry_nb_actions>
+					<entry_sum_visit_length>1</entry_sum_visit_length>
+					<entry_bounce_count>0</entry_bounce_count>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<sum_daily_entry_nb_uniq_visitors>1</sum_daily_entry_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>0%</exit_rate>
+					<url>http://example.org/category/Page1</url>
+				</row>
+				<row>
+					<label>/Page2</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>0%</exit_rate>
+					<url>http://example.org/category/Page2</url>
+				</row>
+				<row>
+					<label>/Page3</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>0%</exit_rate>
+					<url>http://example.org/category/Page3</url>
+				</row>
+			</subtable>
+		</row>
+		<row>
+			<label>/Contact</label>
+			<nb_visits>1</nb_visits>
+			<nb_hits>1</nb_hits>
+			<sum_time_spent>0</sum_time_spent>
+			<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+			<avg_time_on_page>0</avg_time_on_page>
+			<bounce_rate>0%</bounce_rate>
+			<exit_rate>0%</exit_rate>
+			<url>http://example.org/Contact</url>
+		</row>
+		<row>
+			<label>/Home</label>
+			<nb_visits>1</nb_visits>
+			<nb_hits>1</nb_hits>
+			<sum_time_spent>0</sum_time_spent>
+			<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+			<avg_time_on_page>0</avg_time_on_page>
+			<bounce_rate>0%</bounce_rate>
+			<exit_rate>0%</exit_rate>
+			<url>http://example.org/Home</url>
+		</row>
+		<row>
+			<label>Contact</label>
+			<nb_visits>1</nb_visits>
+			<nb_hits>1</nb_hits>
+			<sum_time_spent>0</sum_time_spent>
+			<exit_nb_visits>1</exit_nb_visits>
+			<avg_time_on_page>0</avg_time_on_page>
+			<bounce_rate>0%</bounce_rate>
+			<exit_rate>100%</exit_rate>
+			<subtable>
+				<row>
+					<label>/ThankYou</label>
+					<nb_visits>1</nb_visits>
+					<nb_hits>1</nb_hits>
+					<sum_time_spent>0</sum_time_spent>
+					<exit_nb_visits>1</exit_nb_visits>
+					<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+					<sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors>
+					<avg_time_on_page>0</avg_time_on_page>
+					<bounce_rate>0%</bounce_rate>
+					<exit_rate>100%</exit_rate>
+					<url>http://example.org/Contact/ThankYou</url>
+				</row>
+			</subtable>
+		</row>
+	</result>
+	<result date="2010-02" />
+	<result date="2010-03" />
+</results>
\ No newline at end of file
diff --git a/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__VisitsSummary.get_month.xml b/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__VisitsSummary.get_month.xml
new file mode 100644
index 0000000000000000000000000000000000000000..9f536d593769bffe7a25b30643a831df63be1198
--- /dev/null
+++ b/tests/integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__VisitsSummary.get_month.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<results>
+	<result date="2009-10" />
+	<result date="2009-11" />
+	<result date="2009-12" />
+	<result date="2010-01">
+		<max_actions>6</max_actions>
+		<nb_actions>6</nb_actions>
+		<nb_uniq_visitors>1</nb_uniq_visitors>
+		<nb_visits>1</nb_visits>
+		<sum_visit_length>1</sum_visit_length>
+		<bounce_rate>0%</bounce_rate>
+		<nb_actions_per_visit>6</nb_actions_per_visit>
+		<avg_time_on_site>1</avg_time_on_site>
+	</result>
+	<result date="2010-02" />
+	<result date="2010-03" />
+</results>
\ No newline at end of file