How can I copy theme configuration when copying a site? I have written a script that copies a drupal 8 site. The steps go something like this:


dump old site database into file 
replace old site name with new site name in said file
create a new database using that file
Copy all files from the old directory into the new directory
Modify sites.php and settings.php to contain the new site's configuration.


This works (I've debugged the script quite a bit) except for theme settings are not transferred over. Are the theme settings stored in the database? If so, why are my settings not transferred over? If not, where are they stored?

Assuming access only from a command line, how can my script copy theme settings from one Drupal 8 installation to another using the same theme?
Theme settings are stored in the database. However, Drupal 8 has configuration management. You can export the configuration to yml files. Theme configuration is included.

You can download the yml files at /admin/config/development/configuration/full/export

Or you can export it to the configuration folder by
$ drush config-export sync