Two angels are playing chess. They are immaterial, but have the causal powers of moving physical pieces on the board. Along comes a big snake and swallows the board. No worries: the angels keep on playing, but now the positions of the chess pieces are kept track of in their minds instead. So the king, say, was first a material object. But the king then became an object wholly constituted by the angels' thoughts, and hence immaterial. And it is the same king. While in chess you can get a new queen by promoting a pawn, you don't get a new king within a game.
(Of course, I suspect that the true ontology doesn't include artifacts like chess kings.)