I get questions from "move-up" home buyers a lot. It is not easy to sell a home and purchase a new one at the same time. There can be dozens of pitfalls during this process. My advice is to have a mulitple plans for the "what if" situations if you have to sell in order to buy.
I saw this article on Realtor.com and thought it was excellent for this situation: