Sadly, this often leads to a 50% rewrite where key features are missing because I he rewrite team ran out of budget or willingness to code the non-fun parts. Which drives users to misery or competitors.
But I have the feeling, that a prio-list of the needed features is all that is needed.
People say what they need, you implement it, done.
I mean the way other companies steal your customers IS that they implement a better version of stuff you did. So it's either, they do the rewrite (in their case a first write) or you.