Skip to Content
 

DB restore...

10 replies [Last post]
Zzzzz
Zzzzz's picture
Offline
Joined: 06/20/2008

Ok I think I have restored the forums from the db backup. Things look ok to me know, but let me know if you see anything *odd* (besides me!).

zaiga
Offline
Joined: 12/31/1969
DB restore...

Well, the post counts seem to be off. I remember having 600+ post, now it's 300 something. Not a big deal, I'm glad we have the old posts back.

Zzzzz
Zzzzz's picture
Offline
Joined: 06/20/2008
DB restore...

zaiga wrote:
Well, the post counts seem to be off. I remember having 600+ post, now it's 300 something. Not a big deal, I'm glad we have the old posts back.

lol I was just stating that exact thing in the other thread... my count is off also. I will look into that later today. Not sure what we can do about it, but I will take a look.

phpbbadmin
Offline
Joined: 04/23/2013
DB restore...

Zzzzz wrote:
zaiga wrote:
Well, the post counts seem to be off. I remember having 600+ post, now it's 300 something. Not a big deal, I'm glad we have the old posts back.

lol I was just stating that exact thing in the other thread... my count is off also. I will look into that later today. Not sure what we can do about it, but I will take a look.

Don't bother wasting your time with post counts. If they're off, then they're off. Let's instead work on the wiki..

Dave, perhaps you can detail how you got it to reimport (i.e. exact command line) so that it will be easier should we need to do it in the future.

-Michael

Zzzzz
Zzzzz's picture
Offline
Joined: 06/20/2008
DB restore...

Ok here is the info,

1st : Alter the sql backup file so I had just the forums related tables. This included bbposts and bbposts_text tables.

2nd: I had to hand modify those SQL INSERT commands so the length of each INSERT did not cause the max_allowed_packet problem. This required copy and pasting the INSERT INTO potion of the sql X times throughout the data to be imported.

3rd: Once the *new*tables were imported into the DB. I had to execute some SQL statements via the phpMyAdmin page. It involved using an INSERT IGNORE INTO oldtablename SELECT * FROM currenttablename WHERE 1
WARNING:This might not be the exact SQL statement, I need to go look up what I did exactly

4th: I then had to go do some hand cleanup of the bbposts table so it had the correct last post ID, total num of posts and the correct topics.

I think that was it. I will try to *redo* my steps and write up a set of instructions for future use.

As for the post counts, I have a way to fix those I think. But I need time to complete the script and run it!

FastLearner
Offline
Joined: 12/31/1969
DB restore...

Awesome, Dave, and detailed instructions would be great.

Once we're backing up every day (which we are now), we should be able to do a simple restore, ntohing more complicated. I hope.

On fixing the counts, seems like some sore of

UPDATE UserTableWithCounts SET CountField = (SELECT COUNT(*) FROM MessageTable WHERE UserID = UserTableWithCounts.UserID)

Or somesuch (actually, not sure that will work, may need a true script... but maybe not).

And thanks again, very much.

-- Matthew

Zzzzz
Zzzzz's picture
Offline
Joined: 06/20/2008
DB restore...

FastLearner wrote:
Awesome, Dave, and detailed instructions would be great.

Once we're backing up every day (which we are now), we should be able to do a simple restore, ntohing more complicated. I hope.

On fixing the counts, seems like some sore of

UPDATE UserTableWithCounts SET CountField = (SELECT COUNT(*) FROM MessageTable WHERE UserID = UserTableWithCounts.UserID)

Or somesuch (actually, not sure that will work, may need a true script... but maybe not).

And thanks again, very much.

-- Matthew
Post counts are back to normal!

FastLearner
Offline
Joined: 12/31/1969
DB restore...

Awesome!

phpbbadmin
Offline
Joined: 04/23/2013
DB restore...

FastLearner wrote:
Awesome!

Actually the script was flawed I think. Obviously there is NO WAY Fastlearner should have more posts than I do.

-Michael

Zzzzz
Zzzzz's picture
Offline
Joined: 06/20/2008
DB restore...

Darkehorse wrote:
FastLearner wrote:
Awesome!

Actually the script was flawed I think. Obviously there is NO WAY Fastlearner should have more posts than I do.

-Michael
lol

sedjtroll
sedjtroll's picture
Offline
Joined: 07/21/2008
DB restore...

Really good jb... I wish I could be more help in these situations, but really I don't have any idea what it is you guys do to fix the stuff. Maybe that's something I could learn about more.

Thanks for being so diligent!

- Seth

Syndicate content


forum | by Dr. Radut