Historically, the answer has always been to sell first. If however it takes longer to buy a homes than sell your home, you might face the prospect of needing to rent for a short period of time, and thus move stuff twice.
If you buy first, you may face paying two mortgages if you home doesn't sell quickly. So again, you could end up spending more money than you want.
Ideally, you want to put in your listing that you want to try to close at the same time as your new home closes....sometimes you find people who can be flexible, some times you don't..