MyBB Community Forums

Full Version: Getting Error after restoration of DB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Just got my DB restored and now getting this error-

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1062 - Duplicate entry '0' for key 'location1'
Query:
REPLACE INTO mybb_sessions SET uid='1',sid='1594253f1a44b6d88a5593f7b1e1cfdb',time='1297488756',ip='122.163.56.73',location='/forums/index.php?',useragent='Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 GTB7.1 ( ',location1='0',location2='0',nopermission='0'

Forum is present here http://www.learnqtp.com/forums/

I would appreciate any help. (Since yesterday, things have gone real bad due to this issue)
Ok, so after slogging thro' the night to resolve this issue... finally my forums are at least showing up...

Now I see that any posts, threads made between 4/Feb - 12/Feb are not available while the hyperlink to them can be seen. Any suggestions what I should do now?

Here is an example - if you go here http://www.learnqtp.com/forums/Forum-QTP-Beginners you will see a thread titled "purpose of filesystem,excel,xml object creation " under normal thread category, but if you click on that link, you will get a message "The specified thread does not exist."
Looks like the thread is in the threads table but the posts aren't in the posts table. How did you make this backup?? Is this the one that HostGator created...??
Matt - Hostgator had taken a copy of my files and DB before working on restoration (if you remeber from my yesterdays posting). Since the restoration didn't work out well, I asked them to revert to the copy.

Now something very strange happened, the copy that was working very fine earlier, on reverting started giving errors which you can see above (at the top). I ran the Repair DB command and repair table command due to which I think the no of records in the mybb_posts table decreased by 100 (also forum started working without any "internal server errors)").

These 100 records (posts) are the most recent ones. As you rightly pointed out, I have thread in the threads table but not posts in posts table.

I think I have two ways now, 1) one is to restore the mybb_posts table (I also have pre-restoration copy of DB with me) and 2) is to delete the threads altogether. I would of course prefer the 1) route.

With what has happened yesterday, I really don't want to touch my DB now and wish if a mybb expert can fix it. By any chance Matt, would you be able to look at it and see if you could help me with 1). I can provide you the credentials.
Update: Finally I was able to manage all this by myself and had some good learning - technical and host related - in the meanwhile. I chose option 1) above.

Here is what I did - just in case if this happens with someone else.

After this debacle and subsequent restore of my DB. I thought of installing XAMPP and installed myBB locally.

As mentioned above, there were about 100 posts that got deleted after repair. So I imported the older table (pre-restore), with a simple SQL statement , took the diff with current table and inserted the records. After ensuring everything was working fine on local machine, I went to my LIVE site and did the same. Everything worked quite smoothly.

Learning - Never ever rely on your webhost to restore a back up for you, especially if your webhost is hostgator. It messed up my forum and kindaa screwed my weekend.