I take NO responsibility for your actions, this is merely my experience.
It’s really quite simple if you have the tools or at least access to them. I’ve chopped a G17 to a G19 and another G17 to a G26. While I suppose you could measure off of a magazine to do it, find a friend with the appropriate size smaller Glock and use his frame to scribe a template line on your own larger. I suggest fieldstripping both pistols, taking the pins out of the lower receiver of one and drifting the pins halfway out of the other. Mate the two frames using the half-in/half-out pins and scribe the line.
The frame cuts quite easily with a pocketknife, so do a rough cut like that. Then fully assemble your pistol (slide and all) and use a vertical mill to finish the cut to your scribed line. I ran a 1/2” end mill at about 2000 rpm and it cut very nicely.
Two things to keep in mind are the contour of the backstrap and the bevel of the magwell. You may want or need additional work on the backstrap to make it more comfortable, mine are just fine for me. Also, beveling the magwell is always a good idea, but will be necessary on the G19 size grip if you want to use the older NFML mags with the tapered baseplate. If you only have the newer mags you don’t HAVE to do it, but I would suggest it just so you can pick up any caliber appropriate mags and know they will work. I’ll take some pictures and post them if folks are interested.
Some may ask, “Why?” I’ve never liked the G17 grip, the backstrap curves at the wrong place for me and it’s just plain HUGE!!! The G19 grip is almost perfect for me, so I started there. Then I found a cheap 2nd Gen G17 and was thinking the same as Nave Joe. Longer barrel, sight radius, cheaper recoil springs, etc., so it became became my G1726. It is exactly what I want it to be, though I did have to fashion a “lip” at the bottom of the frame where the finger grooves normally are on a G26. That little lip keeps your finger from getting pinched on mag changes with the G26 mini-mags.