how to set the source connection in drupal d2d migrate
The migrate module provides basic migrate functionality while the migrate_d2d module extends on that functionality providing interfaces for reading and importing into Drupal 5, 6 and 7. Migrate comes with Drush integration and supports rolling back migrations which is very handy during development.

Add the following code into your settings.php file or you can specify database connection details within your migration scripts:

&lt;?php 
// Our Drupal 7 database configuration.
$databases = array (   
'default' =&gt;
  array (
    'default' =&gt;
    array (
      'database' =&gt; 'db_drupal7',
      'username' =&gt; 'drupal7_user',
      'password' =&gt; '',
      'host' =&gt; 'localhost',
      'port' =&gt; '',
      'driver' =&gt; 'mysql',
      'prefix' =&gt; '',
    ),
  ),
  // Here we add in the connection to our Drupal 6 database.
  'legacy' =&gt;;
  array (
    'default' =&gt;;
    array (
      'database' =&gt; 'db_drupal6',
      'username' =&gt; 'drupal6_user',
      'password' =&gt; '',
      'host' =&gt; 'localhost',
      'port' =&gt; '',
      'driver' =&gt; 'mysql',
      'prefix' =&gt; '',
    ),
  ),
);


If you want to create the script for migrating the content than please have look at this useful tutorials: 

http://devblog.com.au/migrating-drupal-6-to-drupal-7-with-the-migration-framework
https://drupal.org/node/1813498



Personal suggestion:
Now the migrate_d2d module is providing a stable UI for migration the contents and that is very easy to do as well, have a look at it documentation here: https://drupal.org/node/1813498

Also if you have a larger database than you can use the drush commands to migrate the contents after setting up the database connections, the list of drush commands for migrating the content: https://drupal.org/node/1561820