According to FHS, all global settings are stored in
User data and settings are stored in
/home/user_name for regular users and
/root for root.
Service data, like web pages, may be stored in
/var or somewhere else, you better know your environment.
You have to backup up it all. Also you need to save list of software repositories and list of installed packages(this is things are specific for each linux distrib).
Install clear system. Restore repositories settings. Update avaliable package index. Install all packages from saved list. Restore settings and service data. You have completely the same system.
For example, in Debian/Ubuntu:
/etc/apt/sources.list.d/* for repositories.
dpkg --get-selections > packages_list for packages list.
Install new system. Restore repositories settings.
dpkg --set-selections < packages_list
Now you may restore settings and data.