It's somewhat surprising that the one on 19.07 does not work for you, as the versions are both v2.1 and according to the changelog of minupnpd, the changes I can see are minimal really, and should not break functionality.
I would suspect more an issue with firewall chains or hotplug scripts than anything in miniupnpd being broken.
However, if you insist on changing to the previous version, you can fairly easily change package versions by editing the makefile.
Before I give the more general explanation, the quickest and easiest way to do this (in which case you can ignore everything below this paragraph), is to delete the contents of feeds/packages/net/miniupnpd
in your 19.07 tree and replace it with the one from your 18.06 tree then do a rebuild.
That said, if you want to learn about how to more generally accomplish what you're trying to do, then here is the process you'd typically follow, with specific reference to miniupnpd.
Replacing package versions won't always work for some packages where there is a functionality change or an ABI change or a dependency on a version of Openwrt, so your mileage may vary.
Miniupnpd interacts with different systems in Openwrt, both firewall and hotplug, so once you've done the change you need to verify that it works properly. No guarantees there...
First read the following to give you better understanding of the structure of the Openwrt makefiles.
https://openwrt.org/docs/guide-developer/packages
https://openwrt.org/docs/guide-developer/package-policies
Then, having read this, you will need to update PKG_VERSION
in the Makefile to reflect the version you want. This will break the hash used to validate that the source is downloaded correctly, but you get around that by removing the value for PKG_HASH and instead putting in PKG_HASH:=skip
.
You will use the build system to update this hash value when you're satisfied that it compiles properly.
Comparing the two makefiles, there's no difference in the files that get installed, so you should not need to worry about the rest of the Makefile as it's largely identical between versions.
You will need to manage the patches found in the patches directory as well. You can't just edit the makefile, change the version and not update the patches, as they're specific to the exact version of the software you are compiling.
More info here: https://openwrt.org/docs/guide-developer/build-system/use-patches-with-buildsystem
You'll need to take the patches from patches
directory in the 18.06 version and move it to the patches directory in the 19.07 build tree you've created, deleting any existing patches in the 19.07 build tree. If you don't do this, the patches will likely fail and it will error out.
There are also a bunch of config files in the files
directory. I'm not sure if they have changed much between the two versions, but you'll need to look at these and assess the differences and see if any are specific to either the two versions or to the version of Openwrt (notably firewall and hotplug)
I surmise you will want to keep the contents of the files directory in the 19.07 build tree intact and not replace them with the version from the 18.06 build tree, but from your original post it seems the files from the 18.06 tree actually work on the 19.07 tree, so replace them with the older versions if you prefer.
Once your package compiles correctly, you'll update the hash value by make package/miniupnpd/check V=s FIXUP=1
. You will also probably need to force reinstall it on your live system, unless you bump the PKG_RELEASE number by one.
So, that is more or less the generalized recipe for manually changing versions of software in a package Makefile.