I forked the Discourse repository on GitHub. How can I replace it with the existing Discourse installation on my site?

You haven’t shared what went wrong when you tried just the forked plugin.

Exactly the same way as before it was a core plugin.

Also, what are you changing? Perhaps you can move just those changes to your own plugin.