Hey Siva P.!
Are you asking about moving a Dynatrace OneAgent from a Managed Instance to a SaaS Environment? If so, the supported method would be to uninstall the OneAgent from the Host and to install using the new SaaS tenant's "Deploy Dynatrace" screen as described in the documentation here: https://www.dynatrace.com/support/help/setup-and-configuration/dynatrace-oneagent/#installation-and-...
Please note that changing the ruxitagent.conf file is not a supported feature and if you run into any issues, Dynatrace Support will recommend that you uninstall from Managed and reinstall for SaaS like I described in my answer.
About this uninstall @ old env. + install @ new env. >> do we need to take process injection into account? If I've understood correctly, uninstalling an agent doesn't immediately remove the injection; it'll happen during the next process restart. So what happens if the previous installation's injection is still there, as I'm installing the agent again for the new environment?
Hey Kalle L.!
If you were to restart the Processes that were installed with the OneAgent after the OneAgent was uninstalled, they should un-inject automatically.
The OneAgent will never inject or un-inject on currently-running Processes. It will always make its changes at Process start/restart.