How can I get replacement floorboards to match existing floorboards?
Before doing anything else, give part of the new board a swipe with paint thinner. Dampening it gives you an idea of what it will look like under a clear varnish, and paint thinner evaporates quickly enough that it doesn't tend to raise grain or otherwise interfere with the rest of the finishing process. That'll give you some idea of how much the color really needs to shift.

If you have some scraps of the old floor and of the new wood, a good paint store may be willing to dab the latter with samples of several different stains to see what they'd recommend as a good match. If in doubt, remember that you can always apply more stain in successive passes.

In my case -- and I'm not sure this is a recommendation, just an observation -- I went with a very cautious approach. Oil varnishes, especially older ones, tend(ed) to add a strong yellow tone to the wood. I was going to use water-based poly, which hardens clear. I applied multiple passes of dewaxed shellac (which I happened to have on hand) to the oak thresholds to achieve that color shift, then applied water-based poly as the protective layers. I stopped short of getting a very close match, but it's close enough that the thresholds don't stand out. I'm sure a real stain would have gotten me there faster and more exactly, but this was good enough for my purposes.