So it sounds like you need to essentially duplicate the contents of a document library from one SharePoint site into another, excluding PDFs. The setup you have now is good all you really need to do is add another condition that checks whether the items is a folder or not, and then create the file/folder appropriately. Luckily, a recursive solution is not necessary.
The following is a general description of a flow that will copy all files (including folder structure and excluding PDFs) from one SharePoint site's document library to another SharePoint site's document library:
<the name of the document library you are copying files from>
<the name of the document library you are copying files to>
<the URL of the site you are copying files from>
strTemplateLibraryName
outputs('Get_files_(properties_only)')?['body/value']
items('Apply_to_each')?['{IsFolder}'] is not equal to true
The false branch of your Condition will be all iterations where the item is a folder and should have this structure:
items('Apply_to_each')?['{FullPath}']
last(split(outputs('FullFolderPath'), variables('strTemplateLibraryName')))
<the URL of the site you are copying files to>
<the document library you are copying files to>
outputs('FolderPath')
The true branch of your Condition will be all iterations where the item is a file and should have this structure:
items('Apply_to_each')?['{FullPath}']
first(split(last(split(outputs('FullFilePath'), variables('strTemplateLibraryName'))),item()?['{FilenameWithExtension}']))
<the URL of the site you are copying files to>
items('Apply_to_each')?['{Identifier}']
<the URL of the site you are copying files to>
/variables('strTargetLibraryName')outputs('FilePath')
items('Apply_to_each')?['{FilenameWithExtension}']
body('Get_file_content')
When I made this flow a while back, I was referencing this guide that you might find helpful. It is difficult to write out flows on here so please let me know if you have any questions.