You apply for a new visa.
That's the short form - sometimes, some countries might accept a valid visa in an old passport - but it also depends what airline as that may be the biggest barrier. (Doesn't help you at all if someone says Canada will accept if you can't get on your flight)
Usually Canada will not issue visas with a longer validity than the passport into which it's inserted.
So unless you have some specifics, not much anyone can say about whether it might work. General rule, you probably need a new visa.