The folder you need to back up is whatever folder you specified at installation. If you left it as the default it’s:
C:\Users<yourusername>\Appdata\Local\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalCache\Packages
Note that Appdata is a hidden folder. That bottom-level Packages folder can be anywhere you like; specify it at reinstallation time, copy your backup into it, and you’re ready to fly.
To illustrate, I have the sim on C: as per the default, and my packages are in D:\FSPackages. That contains both Community and Official\OneStore. I too had to reinstall a few months ago (not the sim’s fault, something different), and after I did the above, the sim made friends with my packages straight away and off I went into the wild blue yonder.
Remember that, if packages have been updated between uninstall and reinstall, the old packages will probably cause problems, so you’ll need to check Content Manager before trying to fly.
ETA: that’s odd; in the path in my post, there should be a backslash after “Users” but the forum won’t let me enter it. Oo-er…