for most civilized countries, your foreign visa continues to be valid until the expiration date stated on the visa. You do have to carry your current valid passport with the old expired passport.
Some countries will be glad to put a new visa in your new passport, for a fee, of course.