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

phpBB Discussion • Re: Restore hard deleted topic from backup

$
0
0
Script to get the data for lost topic from backup database now looks like this:

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" ]; thenmysqldump 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
mysql -u root -p phpBBdatabase < recordfile in the test machine gives a duplicate error:
Duplicate entry 'XXXXX-XXX-X' for key 'phpbb_search_wordmatch.unq_mtch'
So, maybe again a record that is used and has the same unq_mtch as in the deleted topic?
Also need to solve the issue with index rebuild.
A cli tool is needed, due to size of database.

Statistics: Posted by Foxina — Sat Apr 27, 2024 9:35 pm



Viewing all articles
Browse latest Browse all 2042

Trending Articles