I have a site in temporary production server. Now I got the "final" production environment with two front-ends and a database/file-server.

I had a simple idea how to move the site from one server to another: copy the database to the farm database server, copy the drupal directory to front-end (one to start with), change settings.php to point to the database in database server, copy the Nginx conf-file and just run it.

Now when trying to run for example "drush cr" I get:

 PHP Fatal error: Class name must be a valid object or a string in /srv/site-d8/core/modules/field/src/FieldStorageConfigStorage.php on line 155

  Fatal error: Class name must be a valid object or a string in /srv/site-d8/core/modules/field/src/FieldStorageConfigStorage.php on line 155
  Drush command terminated abnormally due to an unrecoverable error. [error]
  Error: Class name must be a valid object or a string in
  /srv/site-d8/core/modules/field/src/FieldStorageConfigStorage.php, line 155

The same error comes when I try open the site itself by browser. I have been fighting with this for whole the day and getting really frustrated. I found some instructions on the google, but though I changed the drupal core code ( the no-no, I know) to check the existence of the class, but then the error just seems to propagate somewhere else.

The environments should be fully similar except for the farm architecture, Nginx as the web server

The problem is that the site should be running there next Monday plus also another site I haven't even been trying to move.

Any help, anyone?

---- more information

This is to add the question which I accidentally wrote as an answer (yeas it was me all the time).

So now I add the answer to the comment editing it here...

Ok, I checked and it says that the record structure when $class is empty is

    [uuid] => dacacd09-c5fe-44b1-8035-566b102731dd
    [langcode] => en
    [status] => 1
    [dependencies] => Array
            [module] => Array
                    [0] => entity_reference_revisions
                    [1] => node
                    [2] => paragraphs


    [id] => node.field_paragraphs
    [field_name] => field_paragraphs
    [entity_type] => node
    [type] => entity_reference_revisions
    [settings] => Array
            [target_type] => paragraph

    [module] => entity_reference_revisions
    [locked] => 
    [cardinality] => -1
    [translatable] => 1
    [indexes] => Array

    [persist_with_no_fields] => 
    [custom_storage] => 

I also checked that the module for entity_reference_revisions exists in /modules directory. So, how can I resolve the problem itself as the module itself seems not to be missing. Also the paragraphs and node modules exist (paragraphs is sites/{sitename]/modules and node of course in core/modules.

hank, grateful but still (maybe more) confused

p.s. mods could delete the erroneous answer at their will

  • I think I had the same error when trying to deploy my site on a newly created Ubuntu server. I believe I fixed it by installing php-xml extension. You might as well check if that's the issue here. If you're on an Ubuntu server simply install using sudo apt-get install php-xml. – tsega Oct 6 '16 at 7:46
  • I already had that library installed. Thanks for the sugestion anyway :) – user67952 Oct 6 '16 at 11:32
  • This should work fine. Something must be different. This errors happens when you use field types where the classes doesn't exist anymore. On the line above where the error happens, check for empty class name and print out the field type, then you know what's missing. – Berdir Oct 6 '16 at 19:26

protected by Community Oct 7 '16 at 8:20

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Browse other questions tagged or ask your own question.