How long does sourceforge keep older versions / Where can I download an old version?
EDIT: as Coleman pointed out on the forum, SourceForge downloads seem to work sometimes. I just retried 4.1.6 and it worked.

In theory, the upgrade documentation says that we can upgrade from CiviCRM 2.2 to 4.7. I have doubts on that, however upgrading from 4.0 to 4.7 should work. A few years ago, I managed to run upgrades from CiviCRM 1.7 to 2.0, then 2.0 to 2.1, 2.1 to 4.0. So in your case, I would recommend 3.1 to 4.0 (or even 4.1?), then to 4.7.

The are archives available up to CiviCRM 4.1 if you use the following URL:

CiviCRM 4.1:

https://download.civicrm.org/civicrm-4.1.6-drupal.tar.gz
https://download.civicrm.org/civicrm-4.1.6-drupal6.tar.gz
https://download.civicrm.org/civicrm-4.1.6-joomla.tar.gz  (etc)

CiviCRM 4.2:

https://download.civicrm.org/civicrm-4.2.19-drupal.tar.gz
https://download.civicrm.org/civicrm-4.2.19-drupal6.tar.gz
https://download.civicrm.org/civicrm-4.2.19-joomla.tar.gz
https://download.civicrm.org/civicrm-4.2.19-wordpress.tar.gz

For CiviCRM 3.0 to 3.3, you will have to use SVN. It's not that bad, although I don't know if it will run on a current version of PHP 5.6. It might work on PHP 5.3.

svn checkout http://svn.civicrm.org/civicrm/branches/v3.4 civicrm-3.4
cd civicrm
cd xml
php GenCode.php


As you have probably noticed the version number in the above URL (v3.4), you can repeat the same process for versions v3.3, v3.2 and so on.

It doesn't help that the SVN virtual-machine of CiviCRM has been having issues lately (full disk). I cleared up some space, but the issue will only be resolved for good next week (another service needs to be moved off that VM).

Reference: Installing CiviCRM from subversion

Reminder: CiviCRM 3.4 is the same as CiviCRM 4.0, but 3.4 is for Drupal 6 and 4.0 is for Drupal 7.