We recently had a security breach and those making the decision opted to remove the capability of end users to create the file upload component.
What I am hoping to do is two-fold:
1.) Use drush sql-query to iterate through all our databases and return all webforms using the file upload component. Optimally this output would need to be sent to a .txt file or something similar so that we know which webforms to address and which sites were using it.
I am hoping to use sql-query with a SELECT statement to look at the webform_component table to get this data so that we can take action.
I know how to drush simple things to a text file, on each database directly (drush @cms.name_of_database site-alias >all.txt), and I know how to use drush sql-query to UPDATE but I do not know how to iterate through each of our databases and then output the results of the query into a single .txt file.
2.) Use Drush to disable the file component (Configuration > Content Authoring > Webform Settings) to uncheck the file component.
We have about 300 sites so we are really hoping we can avoid having to manually configure this across all 300 databases/sites.
Note: I am not trying to export/import content types, I am trying to query our databases via drush and output the results into a .csv or other file type. My second issues is that I need to iterate that script across all 300 databases we have and output the results to either a single file or a file for each db
drush sa
to list the aliases, refine if needed, then loop over and run a drush command for each to gather data – Clive♦ Dec 2 '20 at 17:43