You can extend the residence permit without even leaving China. To do this you need to get release letter in Chinese from the previous employer. And a paper proving your foreign experts certificate cancellation. After this you should get a new job and collect a new set of documents for the extension of the residence permit. To learn more about this, read the article on our website.