Selling and rebuying stock to raise cost basis before moving to a higher-tax state
Moving from Texas to California in about four months and I've been sitting on a lot of unrealized gains in my taxable brokerage account. Someone told me I could sell my positions now, pay federal capital gains tax at my current zero-state-tax rate, then rebuy immediately to step up my cost basis before I become a California resident. That way future gains would be taxed at the new, higher basis. I get the basic idea but I'm worried about wash sale rules killing the whole strategy. These are stock ETFs, not individual securities I'm selling at a loss—I'd actually be selling at a gain. I've also read something about California having its own residency rules that could claw back gains. I've already tried reading through Publication 550 but couldn't find anything that addressed the state transition angle specifically. Is this strategy actually viable, and what are the tax mechanics I should understand?