Introduction:
In order to know the location of the visits your website received before you started using Piwik with GeoIP you need to run a command.
The reference to this command is at: https://piwik.org/faq/how-to/faq_167/
Problem:
Unfortunately after having logged in as root in the server this command gave me the following error:
Could not open input file: ./console
After doing research and using my own Linux experience here is a(the?) solution:
Ref: https://stackoverflow.com/questions/10637230/could-not-open-input-file-app-console
Solution:
# Make temporarily the www-data user login possible
usermod -s /bin/bash www-data
# Login as www-data
sudo su - www-data
# Change the htdocs directory to the installed Piwik.
cd /var/www/piwik.myserver.com/
# Run the command
php ./console usercountry:attribute 2012-01-01,2013-01-01
Result:
Re-attribution for date range: 2012-01-01 to 2013-01-01. 0 visits to process with provider "ip2location".
Completed. Time elapsed: 0.819s
# Get out of www-data user login and back to root login
exit
# Prevent back login of the user www-data(as it was originally)
usermod -s /usr/sbin/nologin www-data
Important Note:
In the command given you need to give the exact date range (eg. 2012-01-01,2017-11-01) which needs to be evaluated in your Piwick reports.