Quantcast
Channel: phpBB.com
Viewing all articles
Browse latest Browse all 2233

phpBB Discussion • Re: Restore hard deleted topic from backup

$
0
0

Code:

#!/bin/bash# Get data for topic 4330mysqldump phpBBdatabase phpbb_posts --no-create-info --where="topic_id=4330" --complete-insert > recordfilemysqldump phpBBdatabase phpbb_topics --no-create-info --where="topic_id=4330" --complete-insert >> recordfilemysqldump phpBBdatabase phpbb_topics_posted --no-create-info --where="topic_id=4330" --complete-insert >> recordfilemysqldump phpBBdatabase phpbb_topics_watch --no-create-info --where="topic_id=4330" --complete-insert >> recordfilemysqldump phpBBdatabase phpbb_topics_track --no-create-info --where="topic_id=4330" --complete-insert >> recordfilemysqldump phpBBdatabase phpbb_bookmarks --no-create-info --where="topic_id=4330" --complete-insert >> recordfilemysqldump phpBBdatabase phpbb_poll_options --no-create-info --where="topic_id=4330" --complete-insert >> recordfilemysqldump phpBBdatabase phpbb_poll_votes --no-create-info --where="topic_id=4330" --complete-insert >> recordfilemysqldump phpBBdatabase phpbb_attachments --no-create-info --where="topic_id=4330" --complete-insert >> recordfile#mysqldump phpBBdatabase phpbb_drafts --no-create-info --where="topic_id=4330" --complete-insert >> recordfilemysqldump phpBBdatabase phpbb_log --no-create-info --where="topic_id=4330" --complete-insert >> recordfile# need to get all post_ids which are related to the topic 4330post_ids=$(mysql phpBBdatabase -N -e "SELECT GROUP_CONCAT(post_id SEPARATOR ',') FROM phpbb_posts WHERE topic_id = 4330;")# to populate phpbb_search_wordmatch and phpbb_reports tablesif [ -n "$post_ids" ]; then# mysqldump phpBBdatabase phpbb_search_wordmatch --no-create-info --where="post_id IN ($post_ids)" --complete-insert >> recordfilemysqldump phpBBdatabase phpbb_reports --no-create-info --where="post_id IN ($post_ids)" --complete-insert >> recordfileelse    echo "No post_id values found."fi### END
So, if I comment out the phpbb_drafts and phpbb_search_wordmatch, I can then run the file against a backup copy of the current phpBBdatabase without any errors.
The deleted topic is also available.

Not found by phpBB Native Fulltext search though.
Trying to rebuld the index from ACP gui in test environment crashes.
Probably would need a cli option for that.

Statistics: Posted by Foxina — Sun Apr 28, 2024 2:03 pm



Viewing all articles
Browse latest Browse all 2233

Trending Articles