help restoring a ch...
 
Notifications
Clear all

help restoring a chapter and reviews

10 Posts
2 Users
0 Reactions
2,326 Views
Jan_AQ
(@jan_aq)
Posts: 1300
Noble Member
Topic starter
 

One of my authors deleted her story by accident (and by relation all of her reviews). I managed to restore the story and all of it's chapters from an earlier saved database, but my problem is now, how do I restore all of her reviews?

I started to copy and paste them from the old saved database .txt file but that is taking forever. She has over a hundred reviews.

Please help! ๐Ÿ™‚ Thank you!


Whoever said nothing is impossible never tried slamming a revolving door.

url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word

 
Posted : 07/05/2007 11:15 pm
Jan_AQ
(@jan_aq)
Posts: 1300
Noble Member
Topic starter
 

Okay, this is what I did.

I took the entire reviews.sql backup and did a find and repace to change every instance of the table to something else. Then I imported it, and searched it for all reviews of this particulr story. I exported all those reviews, and now I'm going to change their table back to the original table and add them.


Whoever said nothing is impossible never tried slamming a revolving door.

url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word

 
Posted : 07/05/2007 11:35 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

I seem to be having the same problem, and was wondering if you could help me determine feasibility.  Any help at all would be greatly appreciated! (The site is dracoandginny.com, and we're still on 3.2.1 for another two weeks.)

Basically, the same thing happened as you described here and in this post.  The author accidentally deleted her story, and I'm probably going to use a backup from two months ago to restore it.  My problem is that I haven't ever tried something so drastic with the databases.

From what I gather you had to change the table name on the old data so that you could upload the it to the same database without overwriting, right?  I was thinking of uploading the entire backup copy of the database from the live site to my test site in order to export what I need, so I wouldn't have to change anything.

My only worry (and perhaps this is silly) is that this story was the largest on the archive, with 97 chapters and over 2000 reviews.  This makes me nervous, particularly since it's an older backup.  Aside from having to change the database in order to be able to export the info (which I plan to avoid), did you have to do a lot of manual changes?


 
Posted : 11/07/2007 11:31 pm
Jan_AQ
(@jan_aq)
Posts: 1300
Noble Member
Topic starter
 

it's easy. If you're using another database then you don't have to do the find and replace part. Just make sure that you export the reviews ONLY for that story. Then Import them into the real database. No new reviews should exist with the same review IDs numbers.

For the large number, I don't think it will be a problem. Just try doing it at 3 am in the morning, or post a news item warning people of some downtime or sluggishness, just in case it happens.


Whoever said nothing is impossible never tried slamming a revolving door.

url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word

 
Posted : 12/07/2007 12:08 am
(@lyndsie)
Posts: 1263
Member Moderator
 

Thanks for responding so quickly! I'm probably not going to do this until we shut down the site for upgrading anyway, so it wouldn't matter if there was downtime.

I probably just not thinking this through, but do you know of a good way to get the reviews for the entire story, since sid isn't a field of the reviews table?  I'd rather not have to do each of the 90+ chapters individually if I don't have to.  Though it actually might be the smarter way, instead of all 2500 at once...

Editing this: My eyes are glazing over, so I thought I'd double-check.  In fanfiction_reviews and fanfiction_favorites, is the field 'item' always the same as the story's sid?  Because it appears to be so, but I'm afraid of it being coincidence for the chapters I checked, and don't relish checking 92 times.  If it is, then I can use that field to select all the reviews for the story at once.


 
Posted : 12/07/2007 8:07 pm
Jan_AQ
(@jan_aq)
Posts: 1300
Noble Member
Topic starter
 

Yes, item in reviews means the story ID. ๐Ÿ™‚

Your biggest worry should be trying to export reviews that do not exist in the current table. If they don't exist then importing them all at once will happen easily, but as soon as it comes across one review id that already exists, the whole thing stops. So, don't worry about it. Messing up only means that you will be trying to add something that already exists.

Just don't drop or delete the reviews table by accident.  ๐Ÿ˜ฎ


Whoever said nothing is impossible never tried slamming a revolving door.

url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word

 
Posted : 12/07/2007 10:49 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

Great!  That makes this about 92 times easier.  I'll let you guys know how it goes... I'm putting the site on maintenance mode on Sunday to do it, since it's a lot of data and I'm not that sure I won't mess something up.

(edit) That's part of the reason I want to put it on maintenance mode, actually.  I'm afraid people might favorite the story before I import the favorites data and muck the whole thing up with duplicates.  (It was favorited 300+ times, so I can see that happening.)


 
Posted : 12/07/2007 10:52 pm
Jan_AQ
(@jan_aq)
Posts: 1300
Noble Member
Topic starter
 

That's why when a story is deleted, you should try and put it back up asap.

You can add the favorite data before the actual story data I think, and you can add it before the reviews table. Adding 300 things is easier and quicker than 2000 reviews.


Whoever said nothing is impossible never tried slamming a revolving door.

url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word

 
Posted : 13/07/2007 7:36 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

It worked perfectly, and everything appears normal.  The author should be uploading the five chapters I didn't have backed up sometime soon.  Thanks for all the help!


 
Posted : 15/07/2007 3:18 pm
Jan_AQ
(@jan_aq)
Posts: 1300
Noble Member
Topic starter
 

great! You're welcome. ๐Ÿ™‚

Make sure that you have the story favorited. Watch for the update notices going out. My author had some problems with it afterwards, which we couldn't figure out. it will probably not be a problem but you should check it just in case.


Whoever said nothing is impossible never tried slamming a revolving door.

url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word

 
Posted : 16/07/2007 2:51 am
Share: