Custom Canonical URLs

Unfortunately, there’s no filter in the rel_canonical() function. But you can remove that function from wp_head altogether and write your own. Try adding this to the functions.php at your old domain:

remove_action( 'wp_head', 'rel_canonical' );
add_action( 'wp_head', 'new_rel_canonical' );

function new_rel_canonical() {
     if ( !is_singular() )
          return;

      global $wp_the_query;
      if ( !$id = $wp_the_query->get_queried_object_id() )
          return;

      $link = get_permalink( $id );
      $link = str_replace( 'olddomain.com', 'newdomain.com', $link );
      echo "<link rel="canonical" href="https://wordpress.stackexchange.com/questions/17265/$link" />\n";
  }

Obviously, just replace olddomain.com and newdomain.com in the second to last line with your actual domain names!