Here are a few ideas:
Task 1: Transfer databases by doing a backup an restore to server D.
Task 2: I think this will involve ETL processes and creating new surrogate keys in database A_D. Keep keys from original source in a data source id column. I think a MERGE statement would be helpful.
Task 3: Leverage logic in Task 2
Update for Task 2:
Say a source Table1
in database A and B has an key column named Table1_ID
. In database A_D add columns Table1_SourceID
and Table1_Source
. Populate Table1_SourceID
with the key from source database, and use Table1_Source
to indicate the source database.
Use Table1_ID
as the key for Table1
, and is unique to database A_D. This will account for collisions for key columns in the source databases. Also, you can track the row to the source database.