Jump to:

22984 Posts in 11765 Topics by 2827 members

General Questions

SilverStripe Forums » General Questions » Restoring database I can no longer save pages

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 745 Views
  • obj63mc
    Avatar
    Community Member
    24 Posts

    Restoring database I can no longer save pages Link to this post

    Hi All,

    I have a site on a dev environment and when I go to set this up on production so users can edit articles, and create new ones, when ever you go to save or save and publish the cms errors out stating it "Error saving content" The actual error is -

    500 Warning: "mysql_query() [<a href='http://www.mysql.com/doc'>http://www.mysql.com/doc</a>;]: Duplicate entry '351' for key 1" at line 95 of C:\htdocs\education-center-2\sapphire\core\model\MySQLDatabase.php

    When I moved to production though all I did was create a mysql dump from dev and then restored it in production. I can view the site all content everything fine just for some reason now all the indexes are messed up and now I can't save content add content etc.

    Any idea how to fix the indexes so this will save properly or why when simply restoring the database this would happen?

  • obj63mc
    Avatar
    Community Member
    24 Posts

    Re: Restoring database I can no longer save pages Link to this post

    To update this I have done some more testing. If I make simple changes to x to many relation ships for say appending a related page, or updating an image, if I press save and publish the page will save and publish but it still is throwing the same error as before.

    If I make a change to say the content section this will save to the draft version (SiteTree) but won't update SiteTree_Live. Then If I go to batch actions and publish it will throw the same error again but it will save this time and publish it.

    Any idea why it is always throwing this error even though it is working or how I can trace down all the sql statments run.

  • obj63mc
    Avatar
    Community Member
    24 Posts

    Re: Restoring database I can no longer save pages Link to this post

    So I have been doing some tracing and logging of all the sql queries that SilverStripe is running for some reason this is running an update statement then an insert statement for the same id to the same table right after one another.

    Attached are all the queries ran when trying to save and publish. Any idea why this would happen?

    Attached Files
    745 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.