Though i have not tried but i would recommend this.
- Stop controller and other services.
- Ask the root user to change owner and group for all the AppDynamics folders recursively using option -R.
- Start the controller and associated services as the new user.
- validate everything works fine.
- Continue with the upgrade.