OK, the title of the ticket is misleading. We are NOT wiping out the configuration of your site, ever. Your question is why the database connection information in the database restoration page is sometimes filled in and sometimes not. That's very different than wiping out the configuration of your site.
The database connection information for your site is typically saved in your backup unless you have explicitly said otherwise in Akeeba Backup's Configuration. So, first thing to do is check that. For all backup profiles go to their Configuration page. Find the “Database backup engine” row. Click on “Configure...” next to it. Find the “Blank out username / password” checkbox. Make sure it is NOT checked. This ensures that the information is present in the backup.
The next thing to consider is the hostname you backed up from and the hostname you are restoring to. Do remember that example.com and www.example.com are two different hostnames. If you have taken the backup on example.com but you are restoring it on www.example.com (or vice versa) the restoration script considers it a restoration to a different site and will blank out the database connection information. This is on purpose. The population of users restoring a site to a different server without realizing they need to provide different db connection information is three orders of magnitude higher than the population of users backing up in www and restoring in non-www (or vice versa) which is, in turn, an order of magnitude higher than the population of users accessing their sites from two or more entirely different domains.
The most likely cause of your problem is your configuration.php file. If you've set a $live_site there you might want to set it back to empty. It's not necessary for the overwhelming majority of Joomla installations. If that's not the case, set a redirection from the non-www hostname to the www hostname (e.g. example.com to www.example.com) to normalize the way you and your visitors access to site. As a corollary you will now always be backing up and restoring your site from the hostname that includes www, meaning that your db connection information will be pre-populated for you.
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!