Merging piwik from different installations

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?

thanks

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

right… so its not possible?

what if we had different prefixes for the php table?

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.

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:
http://www.jan-muennich.de/merging-two-piwik-installations

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:

domain.com/piwik
domain.com/piwik2
domain.com/piwik3
domain.com/piwik4

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.