It depends on a few things.
What kind of loan do you have on your townhouse?
What is reason for the upgrade? Has your family out grown the townhouse?
How much do you have for a down payment?
Can you qualify for a new mortgage while still paying the existing without including rental income from the townhouse?
Are there any other reasons for moving, like relocating for work or to be closer to work?
You need to have a mortgage professional go over the details with you to see where you stand.