It is sometimes possible to transfer between doctoral programs and get credit for all the coursework you have completed and for having already passed the Ph. D. qualifying exam. However, I think the odds are probably against it. Getting credit for some of the coursework is generally possible, although many departments place limits on the number of graduate-level credits that can be transferred from another university, and many will also insist that Ph. D. transfer students take the qualifying exam, regardless of whether they had passed it at their original institution.
In my department, we have only given a transferring student student credit for passing the qualifying exam once, and that was in a fairly unusual situation. Our department had hired an endowed chair, and the new chair wanted to bring along her current graduate students, one of whom was quite advanced—finished with coursework and the qualifying exam. The chair wanted the advanced student to get credit for everything she had already done, so all that she would need to complete in our department was her dissertation. In response to the request, our director of graduate studies scrutinized the student's course record and decided that it was satisfactory. Then he and I (who am chair of the committee that oversees the qualifying exam in our department) together looked at the parameters of the qualifying exam in the student's original program, and we determined that it was very similar to the exam in our own department. On the basis of these investigations, we decided to give the student credit for everything she had done in her old program, as her advisor has requested.
So it is possible for this to happen. However, for a student without a powerful sponsor (a newly hired endowed chair is a pretty important person in the department), we probably would not have even considered making a special exception, and we would have required the student to retake a certain number of advanced classes and to take our departmental qualifying exam. Other departments might be more accommodating, but I still think the odds would definitely be against you.