How to split existing db data for single directory for new site?

I am attempting to isolate the all of the data for hits on a server sub-directory out to a new piwik “site” so that there can be separate piwik sites (using the existing historical data) for each: (as piwik site 1) (as piwik site 2)

A SQL query of:

SELECT idaction FROM piwik_log_action WHERE name like “subdirectory%” ;

…provides a list of the ‘idaction’ values that I need to isolate within the piwik_log_action table, but I’m not sure how to then use that list to isolate the related rows in the piwik_log_link_visit_action and piwik_log_visit tables. Can anyone provide suggestions on this might be done or the table relationships? Thanks in advance…