I would add, How old is the chain? Sometimes you can have an old worn chain that works acceptably on the cassette that it’s been used with which has also worn, but it will skip with a new cassette, or at least hasten the wear of the new cassette.
I’d measure the chain for wear before adding the new cassette, or if the chain has a fair number of miles in it, just start with a new chain.
If you do replace the chain, and are going to use it with both cassettes size it for the 11-34.
__________________
You could fall off a cliff and die.
You could get lost and die.
You could hit a tree and die.
OR YOU COULD STAY HOME AND FALL OFF THE COUCH AND DIE.