Custom Search configuration settings created at the site or site collection scope, such as results sources, query rules, and result types are stored in the Search Service Application. Therefore when a site or site collection backup/restore, or export/import occurs these settings don't come along for the ride.
The best, and easiest way to maintain those settings across environments is to use the built-in Search Configuration Import/Export utility within the SharePoint UI. Details about this process are documented here so I won't cover the process in this post.
What is important in that article, however, is that you meet the following criteria when importing:
That the search configuration file and the target for your import do not have settings with the same name, except for managed properties.
That the source of your export does not include managed properties or aliases that contain the invalid characters listed in Invalid characters causing the import to fail.
That managed property names and aliases are unique within the combination of the search configuration file and the search configuration settings on the target site and its parent site collection.
Also important is this list of reasons the import might fail:
If the search configuration file and the target for your import have settings with the same name, the import of the search configuration file fails when it encounters this setting. Exceptions:
If you reimport a search configuration file, the settings that have the same name in the search configuration file and on the target do not cause the import to fail.
Managed properties with the same name do not cause an import to fail if the individual managed property settings are the same on the property in the search configuration file and on the target property.
Managed properties with the same name do not cause an import to fail if the aliases and mappings to crawled properties are different on the managed property in the search configuration file and on the target managed property. The import adds the aliases and mappings on the managed property in the search configuration file to the aliases and mappings on the target managed property.
If the search configuration file contains managed property names or aliases that contain invalid characters, the import fails when it encounters that managed property name or alias.
The managed property names and aliases of a search schema must be unique for a site and its parent site collection. This means:
If your search configuration file has a managed property that has the same name as an alias for a managed property on your target site or the parent site collection of your target site, then the import fails.
If your search configuration file has a managed property with an alias that has the same name as a managed property on your target site or the parent site collection of your target site, then the import fails.