Merging piwik from different installations

(HarryPotter) #1

another thinking ahead question

say i have two individual setup of piwik on two separate site, tracking multiple sites. if one day i decide i only want to keep track of everything in one install, can i merge the two databases together?


(vipsoft) #2

Theoretically… you would need to have unique idsites to merge these into the same database.

(HarryPotter) #3

right… so its not possible?

what if we had different prefixes for the php table?

(vipsoft) #4

Theoretically it’s possible. You would have to construct the SQL UPDATE queries to change the idsite. Add the site. Then insert the rows from the second db.

(HarryPotter) #5

interesting, and good to know it’s possible.

i guess i will worry about this when the time comes


I’ll have to do the same thing and found this:

I haven’t tried it, but maybe it helps.


Just a heads up that that script works and is the bomb.


If one has multiple installations at say:

And one wants to merge them all into the /piwik install, can one forward updates being send to the old installations (e.g. JavaScript using /piwik2) without editing the JavaScript at all the individual domains that are being tracked?

Also, does this script still work with the latest Piwik?


Does anyone know how to forward updates after a merge without editing the javascript at each domain?

Perhaps with a .htaccess rewrite rule. Although I’m not sure how the change of site IDs would work after a merge.