Search Wiki:
Transfer Jobs and Logins using SSIS

Deepak, Oct 16, 2008

We can use SQL Server Integration Services to transfer the logins and jobs from SQL 2005 to another SQL 2005 or SQL 2008. This comes in handy when its difficult to script each of the jobs. Firstly we need to create an SSIS package.

1. Open Bussiness intelligence development studio – click file new project – select integration services project as the template and provide a suitable name for it.

d1.jpg

2. Open solution explorer using Ctrl + Alt +L or go to view and select solution explorer. Expand SSIS under solution explorer and expand SSIS packages – right click and select new SSIS package

3. Drag and drop Transfer Job task from Control flow item into Control flow tab and double click it

d2.jpg

4. In the general tab, give a specific name and description for the transfer job task

5. In Jobs tab, specify the source and destination server name under connections and test the connection as shown below,

d3.jpg

6. We also have an option to specify whether to transfer all the jobs or specific jobs. In my case I am setting the option as False so as to transfer only specific jobs. Then we need to select the list of jobs that needs to be transferred from the ‘JobsList’

d4.jpg

7. In the options, if the objects already exist (in our case it is the job) we need to specify what needs to be done. We can either specify it as FailTask if the job exists in destination or skip the object or overwrite it if it’s already present

8. Finally we need to specify the option to enable the jobs in destination server after getting transferred

Once the above steps are completed we need to save the package (Ctrl + S) and execute it as shown below. We can view the status of the package execution under ‘Progress’ tab.

d5.jpg

We also have an option to rename the package as indicated by the arrow marks.

d6.jpg

Once the package has executed successfully we can schedule the package as a job. First connect to Integration service – right click MSDB – Import package – select file system – specify the package path – and provide a name for the SSIS package.

d7.jpg

Expand SQL Agent node and right click on Jobs – new job and select the ‘type’ as SQL Server Integration Services Package. Specify server name and package source as SQL Server. Click the ellipse button next to ‘package’ and select the package we created. Specify the schedule for the job as per your desire.

d8.jpg

To create a package for Transfer login task, we need to create a new package and drag and drop the transfer login task from control flow items window and specify the source, destination server name. We need to choose the option to transfer all the logins or selected logins for specific databases. Also we have option to overwrite/skip/fail the package similar to the transfer job task. Finally we need to set the option ‘CopySids’ as true to transfer the security identifiers as well. We need to enable this option in for transferring logins while doing log shipping where there might be mismatched id due to restore operation.

d9.jpg
Last edited Oct 16 2008 at 9:27 PM  by DeepakRangarajan, version 8
Updating...
Page view tracker