I have installed two Drupal sites in my local Ubuntu desktop 15.10 Apache2 (2.4.12) environment: One is a fresh install of Drupal 8 and The second is a copy of an existing working site built with Drupal 7 (which is mostly core-modules based, very humble by means of pages). Both sites are working fine without any problem, anywhere.

My aim is first and foremost upgrading the Drupal 7 site to Drupal 8. I did all the preliminary stages like configuring the same languages, Keep minimal by means of modules (uninstalling any modules in the D7 site that I could easily bring back after the Upgrade), making sure the same modules are installed in both sites, etc, and now I just want to "Transcend" (hope its a good phrasing) my Drupal 7 site into the fresh Drupal 8 one.

To achieve my aim I've installed the Drupal Upgrade module in my Drupal 8 site, went to localhost/sitename/upgrade, and filled in all the details of the Drupal 7 site.

When I clicked the "Review upgrade" button I got the error:

Source database does not contain a recognizable Drupal version.

I've googled this error as an exact phrase ("Error") and found very few results; Most of them seem to me to require a PHP programming knowledge that I've yet acquired, so I can't determine if the error is due to a bug (especially since this module is still under heavy development) or due to my mistake in understanding the concept\functionality of this module.

  1. What reasons are there that the D8 Drupal upgrade module wont "like" the D7 database I provided? Especially while the Drupal 7 site is working fine both online and locally.

  2. Would migrating be a decent alternative for upgrading, if upgrading isn't possible for whatever reason? If so, what is the best most simple solution You could think of for migration?

enter image description here

I went to /var/www/html/benia/modules/migrate_upgrade/src/MigrationCreationTrait.php and did:

-- return $version_string ? substr($version_string, 0, 1) : FALSE;

++ return 7;
++ return $version_string ? substr($version_string, 0, 1) : FALSE;

Than got this error in top of the screen.

enter image description here

  • 1
    All I can see is that it doesn't like like that database contains a Drupal 7 installation, just like the error says. Something has to be wrong in your configuration or you didn't import it where you expect it to.
    – Berdir
    Dec 31, 2015 at 9:54
  • Why won't it like the DB? The D7 site with this DB works pretty well without any probs...
    – user16289
    Dec 31, 2015 at 12:42
  • 1
    Oh and @Berdir by "configuration" you mean to the conf in the Drupal Upgrade module in the D8 site? I was sure the details I filled where all I need, I'll check if I've missed anything... You think I missed something?...
    – user16289
    Dec 31, 2015 at 12:44
  • Have you tried instead localhost already? (As it maybe really doesn't get through to a database at all with your current upgrade config)
    – leymannx
    Jan 1, 2016 at 23:20
  • Sorry I think I did understand... Can you please rephrase what you wrote? Much thanks!!!
    – user16289
    Jan 2, 2016 at 2:01

4 Answers 4


At this stage, I don't think there is a simple option to upgrade from 7 to 8. As you can see on the release note:

Once you are ready, Drupal 8 core also includes the Migrate module to update existing Drupal 7 and 6 sites to Drupal 8 directly. Migrate is marked "experimental" in Drupal 8.0.0, but will be fully supported in an upcoming release. https://www.drupal.org/news/drupal-8.0.0-released

A little bit technical behind the scene: From 7 to 8 version, they keep the same concept when building site (like node, entity, permission, views...) but not the core. I would say: they changed everything to OOP, Symfony component, architecture... So there is no way to upgrade your drupal site directly from decent version to 8.0, you have to migrate. Here is how the migrating process should look:

  1. Recreate the site with the same functionality to your d7 site.
  2. Recreate the theme (using twig template)
  3. Migrate content over

The cost to this process is (unfortunately) same to recreate a new site or more. With the no 3, take a look at this article by Phase 2: https://www.phase2technology.com/blog/upgrading-to-a-drupal-8-site/

  • I have started to manually building a rewritten site in Drupal 8... It is good indeed that many of the modules I used in D7 went into the core; I hope that in the time being when I will migrate to Drupal 9, the migration technology would reach a state where it can be more partial, done in different contexts, Node on-page data & meta data, node redirects, files, Views, Panels, everything to it's own as much as possible... splitting the process to different stages (when you could start from each possible stage whenever you like) is something I hope to...
    – user16289
    Jan 6, 2016 at 5:18
  • Sorry to unapply: I just posted my answer below with specific details on what most probably happened, please see. The bounty is with you, of course.
    – user16289
    Sep 24, 2016 at 7:52

Your error message is an exact match with the string contained in the line at http://cgit.drupalcode.org/migrate_upgrade/tree/src/MigrationCreationTrait.php#n40 within the code of the "Drupal Upgrade" module (https://www.drupal.org/project/migrate_upgrade).

It shows that it is not a bug, but instead an "exception being thrown". Looking at the 3 proceeding lines of that code, I think it is only a problem in setting up the connection.

See also comment #3 on Drupal Database not recognized.

To check that the source database is a valid Drupal database, and to determine the version of the database, the upgrade process looks at the 'system' table - is that table present in the database you specified in the form? Is the Drupal installation in that database prefixed (and if so, did you enter the prefix in the "Advanced options" section of the form)?".

That is followed by comment #4 in that same issue.

Providing tables' prefix solved the issue.

And of course, the comment from benjy would also help to get more details about the actual error you're running into.

You could print out $e->getException() and then you'll see the PDO error.

You could (temporary) add such print between lines 122 and 123.


Once I got that error message. It turned out to be the database prefix set by me, drupal_. You should put that in the advanced options.


I left 2 modules installed, which I (then) thought to be "so basic" they had a migration path just as all core modules have. These were, if I remember correctly, Metatag and Redirect.

These, and other modules, do now have contributed migration paths you can use by patching them with this migration path. (You "inject" it into the module with the path.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.