Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import into existing site #15

Open
koehnlein opened this issue Feb 10, 2020 · 1 comment
Open

Import into existing site #15

koehnlein opened this issue Feb 10, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@koehnlein
Copy link

Hi everybody,

I have to separate Matomo installations. Each of them with about 30 to 40 configured sites. I now would like to merge the two installations into one and found your tool.

As far as I understood, your tool always creates a new site when migrating site data from "source" to "target"? So I only can change the tracking URLs after migrating the data. Unfortunately, this would cause a loss of data in the timespan between "creating the site in the target Matomo installation" and "updating the tracking code to the new URL".

My idea would be ...

  1. configure the site in the target Matomo installation
  2. change the tracking URLs on my websites
  3. migrate old data from "source" to correspondending/existing site in "target"

In this way, I would not have any timespan with data loss. Or are there any other recommended workflows to switch from one installation to another?

@tsteur tsteur added the enhancement New feature or request label Feb 10, 2020
@tsteur
Copy link
Member

tsteur commented Feb 10, 2020

Haven't tested, but you could do something like this if you have access to webserver logs

  • Configure your existing Matomo's to no longer record tracking requests (there is some config setting like record_statistics = 0. You need to remember the time when this was deactivated
  • Then you start the migration
  • Then you change the tracking code to the new Matomo. Remember the time this was activated
  • Then you replay the tracking requests from your old/previous Matomo which weren't recorded previously see https://matomo.org/faq/log-analytics-tool/faq_19221/ with something like this

./misc/log-analytics/import_logs.py --url=matomo.example.net --replay-tracking --idsite=$newidsite --url=$newMatomoUrl --exclude-older-than=$rememberedTimeStart --exclude-newer-than=$rememberTimeFinished /var/log/apache2/access.log

This is not tested though. For further questions about this feel free to ask in the forum: https://forum.matomo.org/ and check out the import logs script https://github.com/matomo-org/matomo-log-analytics

If the migration for each site otherwise goes fast maybe it be fine to have no data for just a few hours? Really depends on the amount of data you have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants