Two examples using the term "fishing" help make the distinction clear (example drawn from Dirven, 1996). The phrase "to fish pearls" uses metonymy, drawing from "fishing" the idea of taking things from the ocean. What is carried across from "fishing fish" to "fishing pearls" is the domain of usage and the associations with the ocean and boats, but we understand the phrase in spite of rather than because of the literal meaning of fishing: we know you do not use a fishing rod or net to get pearls and we know that pearls are not, and do not originate from, fish.
In contrast, the metaphorical phrase "fishing for information", transfers the concept of fishing into a new domain. If someone is "fishing" for information, we do not imagine that he or she is anywhere near the ocean, rather we transfer elements of the action of fishing (waiting, hoping to catch something that cannot be seen) into a new domain (a conversation). Thus, metonymy works by calling up a domain of usage and an array of associations (in the example above, boats, the ocean, gathering life from the sea) whereas metaphor picks a target set of meanings and transfers them to a new domain of usage.