Export data to another installation

Hello, my organisation needs to integrate the statistics of an old piwik installation to a different newer matomo installation. This newer version also contains statistics for different sites. The server for the old installation will be removed soon.
How do I bring the statistics from the old sites into the newer installation in order to have both the statistics for the old sites and the statistics for the new sites living togehter?