Quantcast
Viewing all articles
Browse latest Browse all 4243

Merging two Piwik Installations (no replies)

Hi All,

we have two Piwik (2.13.1) installtions.
One with old data (OLD), the other one is productive (PROD).
Both installations have the same configuration of websites, around 30 profiles.

Requestet target is to get all data in one installation, perfect solution for this task seems to be the Site Migration plugin.
Also a nice feature would be to lose the fewest data possible.
http://plugins.piwik.org/SiteMigration

so I installed Piwik a third time (TEMP).

I used the plugin to
import idsite=1 from OLD to TEMP, new data in TEMP got idsite=1 then
import idsite=1 from PROD to TEMP, new data in TEMP got idsite=2, then
updated idsite=2 in TEMP to idsite=1, and then run
console core:archive on TEMP

~/dev/piwik/old
$ ./console migration:site 1 -v --skip-archive-data -H 1.2.3.4 -U user -P password -N Db_TEMP --db-prefix=TEMP_
~/dev/piwik/prod
$ ./console migration:site 1 -v --skip-archive-data -H 1.2.3.4 -U user -P password -N Db_TEMP --db-prefix=TEMP_

UPDATE TEMP_log_visit SET idsite=1 WHERE idsite=2;
UPDATE TEMP_log_link_visit_action SET idsite=1 WHERE idsite=2;

currently PROD is still tracking data for idsite=1

now it's time to change the tracking code on the website.
or do a redirect in piwik.php.
if it's idsite=1 reditect to www.piwik.TEMP/piwik.php?idsite=1,
other profiles use www.piwik.PROD/piwik.php?idsite=1
so we lose only the tracked data during the import.

PROD is tracking, all profiles idsite=2 to idsite=30
TEMP is tracking, only idsite=1

then import the missing profiles, after each import add the redirect for the imported profile.
so the TEMP installation becomes more and more the NEWPROD installtion.
after importing all profiles, delete the redirects in piwik.php and change the config.ini from the PROD to use the database from TEMP.
voilà a new installtion with all the historic data!
Thank you Piwik.PRO for this great and helpful plugin!!


big question is now: is it possible to import and track websites at the same time?

Viewing all articles
Browse latest Browse all 4243

Trending Articles