Our dev server is on an internal network that is not connected to the WWW. As such, I have the Google Analytics module turned off on the dev server, because it really slows down page loads when enabled, since it can't reach the Google servers. Occasionally, when I migrate site changes up to the production server, I will forget to enable the module on the live site. It gets disabled because it's disabled on dev. Is there a way to exclude module settings from a database backup? (We're using the Backup and Migrate module.)
It probably is possible, but not with Backup and Migrate. BaM only enables you to exclude whole tables, and enabled / disabled status is a row.
Worse, your devel environment contains different set of scripts than production one. This may have various side effects, bugs you will only see after migrating your changes to production. That's exactly what you want to avoid, so consider other options:
Test site in environment that can connect to WWW, either by switching your dev server, or by creating dev/staging machine connected to www-enabled testers' workstations. In this latter case, you will catch if you forgot to enable something.
Good question. Have a look at the [environment project1. It's drush with a php snippet that provides actions based on environment.