Modules are stored in /pineapple/modules/ directory
before you do factory reset:
ssh into your pineapple, run these commands
mkdir /root/backup/
cp -r /pineapple/modules /root/backup/
If a factory reset doesnt blow away your home directory you should be fine.
Otherwise find a directory that wont, and copy the modules dir there.