You should consult with a practice transition advisor 3- 5 years in advance of your goal retirement date. An advisor will be able to provide you with some options or alternatives to an outright retirement. They will also likely recommend an appraisal as your 'first step' so that you will have an idea of what the practice's value is. This will help you to ensure with your financial planner that your retirement timing is coordinated with your overall financial plan.
An appraisal will also help you get a 'health check' on your practice as a good appraiser will review your overhead items and give you some guidance as to the normal levels so that you can get the house in order prior to putting your practice on the market. There are also creative ways to structure the sale proceeds so that you can take advantage of some benefits which would have the result of reducing your overall taxes.
Therefore, talking with someone ahead of time can give you the opportunity to have an advance plan before stepping into retirement.