My nagging lecture didn't persuade you to stay in that fleabag apartment with the roach infestation, huh? Well, sometimes, it is a good idea to move, especially if you're heading for a better job or fleeing a place with fire-code violations.

If you absolutely must move, think of it at every step as a financial transaction as much as a logistical one. Consider some of these ideas to prevent your move from relocating all of your money to someone else's pocket.

  • Do everything possible to qualify for the homeowner's capital gains tax exclusion. That lets you avoid tax on $250,000 in capital gains, or $500,000 -- half a million dollars! -- if you're a married couple filing a joint return. To win this prize, you must have lived in your house for two of the five years before the sale.
  • While you're pondering tax breaks, find out whether you qualify for a moving-expense deduction. Your relocation must be related to a new job. If you can take it, that may net you an above-the-line deduction on your tax return.
  • If you're moving to take a new job, why not ask your future employer for some relocation assistance? Some large companies offer this benefit to many new recruits. But even if you're joining a small firm, it can't hurt to ask.
  • Shop around for a moving service. Get multiple estimates before you choose a mover, and remember that the cheapest available isn't always the best. The American Moving and Storage Association has prepared a very thorough consumers' guide that explains the services that movers offer and the types of estimates you can expect to receive. Make sure you understand what kind of liability the moving company assumes if your goods get damaged or stolen during transit.
  • Do your own packing. Paying the moving company to pack your goods can add up to a lot of money spent on something you could have done yourself. The moving company might say it takes no responsibility for items you've packed if they get damaged during shipping -- and if that's the case, let the moving company pack only your irreplaceable goods, and still pack the rest on your own. If you have heirlooms, consider transporting them yourself.
  • Consider a garage sale if you have a lot of items that you think someone else will want to buy. Or donate the used goods you don't want to move, and get a receipt. Your good deed to charity can probably reap you a tax deduction later.
  • If you're buying a home, examine your closing costs carefully. It's easy for these items to get lost in the shuffle, because they often seem to be a drop in the bucket compared with your other expenses. Yet in dollars, they can add up to thousands.
  • Consider making your cell phone your only phone. If you're young and on the move, doing so will not only cut down on the number of land-line hook-up fees you have to pay, but will also ensure that your friends always have your number, no matter where you go.
  • To the extent you can, time your move so that you carry as few duplicate housing costs as possible. If you're making a sudden move, avoiding these overlaps may not be possible. But if you have time to plan, you also have time to avoid some duplicate expenses.
  • Lastly, think hard about whether you need to upgrade your housing with every move. You might be looking forward to a fat salary at a new job, or you might have a big check in your hand after selling your house. It's tempting to pour all of that money into a palatial estate. Over time, you may end up living larger than you'd ever intended.

On that last point, if you keep your expenses lower by living in a more humble abode, you can even free your money to profit from the housing bust. Could companies such as Countrywide (NYSE:CFC) or Capital One (NYSE:COF), whose stock prices are getting whacked by recent housing woes, represent good opportunities? A handy homeowner may be in the perfect position to know whether Lowe's (NYSE:LOW) and Home Depot (NYSE:HD) make good buys at bargain prices.

For more good tips on moving -- including why you may not want to move at all -- head back to Part 1 of this series.

Related Foolishness:

Looking for more ways to defend your bank accounts from constant attack? Check out Motley Fool Green Light for 30 days, and start building a moat around your castle.

Fool contributor Mary Dalrymple never plans to move again, and she does not own stock in any company mentioned in this article. She welcomes your feedback. Home Depot is an Inside Value recommendation. The Motley Fool has a well-traveled disclosure policy.