To copy an SSIS Environment:
First create a new blank environment.
I created an environment called test.
The test environment has an Identifier of 4.
The environment called Production, I want to copy, has an identifer of 2.
I can go to the SSISDB database and query the variables for Production by running the following script.
SELECT
[name]
,[description]
,[type]
,[sensitive]
,[value]
,[sensitive_value]
,[base_data_type]
FROM [SSISDB].[internal].[environment_variables]
where environment_id = 2
I can then copy these to the new environment by adding entries in the table with the new identifier 4. The following copies all of the variables from Production to the Test Environment.
insert into [SSISDB].[internal].[environment_variables]
SELECT 4 as Enironment_id
,[name]
,[description]
,[type]
,[sensitive]
,[value]
,[sensitive_value]
,[base_data_type]
FROM [SSISDB].[internal].[environment_variables]
where environment_id = 2