2

I get this error after I have migrated my site from local to live.

Notice: unserialize() [function.unserialize]: Error at offset 718 of 1340 bytes in views_db_object->load_row() (line 2251 of /storage/content/16/184116/.com/public_html/sites/all/modules/views/includes/view.inc)

And this results in my site not showing my views. I suspect that this could have something to do with me changing "mylocalsitedirectory" to "mylivesite" in DB before importing DB to live site and ending up having a different serialization in Views than what it expects. But how do I solve this?

3
  • Go to admin/config/development/performance and purge the cache. Maybe it will help you.
    – deem
    Aug 13, 2013 at 12:42
  • Change the serialised string back to its original state, use unserialize to get the php array, change the array value you need to in PHP, then serialize it up again before pasting into the relevant db field. Simple as that :)
    – Clive
    Aug 13, 2013 at 13:01
  • Or, even simpler, change the identifier preceding that value, e.g. s:123: to match the char count of the string after its been changed.
    – Clive
    Aug 13, 2013 at 13:05

3 Answers 3

1

You don't have to delete everything. Using database viewing/querying software (phpMyAdmin, dbForge Express, etc.), you can identify exactly which view is causing problems allowing you to remove only one view or attempt to fix it.

It is detailed in this answer: https://drupal.stackexchange.com/a/105393/8506

0

This is a painful process, but gets the job done.

  • Delete the two tables views_display and views_views
  • Export all views manually using Drupal export view from development environment
  • Import all views manually using Drupal import view in production environment
3
  • Should I not TRUNCATE the two tables and then export data? Or do the import also create the tables?
    – Edd Clark
    Aug 13, 2013 at 12:48
  • The import should create the tables. So truncate the tables
    – 4life
    Aug 13, 2013 at 12:50
  • what if i've got hundreds of views? Any other solution?( Nov 15, 2013 at 11:45
0

I've had some success with this script:

http://davidcoveney.com/782/mysql-database-search-replace-with-serialized-php/

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.