I need to content migrate all pages that has an existing legacy component to migrate it to a new component structure (total nodes found, more than 1000). My plan is to run the groovy script on production author, then to tree-activate the entire tree structure.
Is it best practice to Groovy Console on Production author, then to replicate from Production author?
The answer to your question is yes, you can run groovy script directly on production author and then replicate the content from there.
Technically, there is no problem in that but just because this is the production environment, it would be best to take the backup of the author instance, just in case if something goes wrong, you can go back to the previous state.
Another option is to copy the content of the production to a lower environment, run the script there and package the content from lower environment and deploy it to production. Here, you will have to make sure that while you are doing this, content authors should not be doing any content changes on the production environment, else once you will upload the updated content, their changes can be lost.