How do you save all your installed pacages so you can easily reinstall them all on a fresh install of the OS?

I pulled the trigger on that a little to fast and I cant edit my previous post.
I get the tar archive

but where do I find the packagelist files? I only get the tar archive

When I use the script everything is in the same folder - so assuming you have not changed the locations considerably - same folder as the archive.

I run the script inside the home I want to export and point the location to a mounted USB stick - everything is in the same folder.

The location is printed by the script at the very end.

Example - pointing to a test-copy folder in home (~)

$ which copy-conf.sh
/home/fh/.local/bin/copy-conf.sh
$ cd
$ copy-conf.sh ~/test-copy
 ....
 ==> Packagelists created
   --> /home/fh/test-copy/repo-pkglist.txt
   --> /home/fh/test-copy/cust-pkglist.txt
 ==> Config archive created
   --> /home/fh/test-copy/dotconf.tar.gz
 ==> To install packages from lists
   --> sudo pacman -Syu --needed - < repo-pkglist.txt
 ==> To restore the configuration files run
   --> tar -zxcf dotconf.tar.gz
$ ls test-copy
cust-pkglist.txt  dotconf.tar.gz  repo-pkglist.txt

thank you. I do not get that for some reason. but I’m going to play around with it some more.