Yes and no. Butterflies don’t have a complex memories that humans have, so no they don’t remember being caterpillars. However, caterpillars can be trained to respond to stimuli and they will remember how to react to that stimuli when they’re butterflies. So no they can’t remember being caterpillars, but they can remember stuff they learned while they where caterpillars
There was a study mentioned on an episode of Radiolab where researchers subjected a caterpillar to a shock whenever it was given a particular odor. After turning into a butterfly they continued to avoid the odor. Not sure if they "remember being caterpillars," but the research suggests they do retain memories from that time.
monarch butterflys migrate. it takes 4 generations to reach the southern point or northern point of the migration. They "nest" in the same tree as the butterfly that was their "ancestor" did 8 generations ago so I would say yes.