discuz!3.2 Forum block was mistakenly deleted after the recovery method

Source: Internet
Author: User
Tags current time sql error aliyun
A few days ago due to their own operational errors, will be the forum plate to delete, discuz! After the background section is deleted is unable to restore, the following figure:
Plate removal
Think about it, I'm using the Aliyun ESC server, should have a snapshot save, I do not have the habit of daily backup, open Aliyun backstage to see me in May 1 incredibly saved the snapshot, but can not be directly restored to May 1, to today can be less than 3 days time Ah, can not all snapshots rollback, so began data recovery journey! The following figure:
Aliyun Snapshots
First: We must first save the current time data, there are users of the best in the evening after 11 start operation, to avoid user data loss!
Next, is the operation, to find the deleted plate data, Operation---"Snapshot roll back to May 1-" into the forum-"backstage-" Delete all data (not including mistakenly deleted data), is also said to leave "mistakenly deleted data plate."
Delete clean, into the database management backstage, I used the phpMyAdmin, found 2 tables is "pre_forum_post post table" and "Pre_forum_thread theme table", the following figure:
Data tables
Save all of its data content and save it to local with the SQL suffix name. I am a direct export of SQL statements saved, of course, there are many ways to save, I do not explain, the following figure:
Direct export of SQL statements
Don't think this is the end, this is just the beginning, found the "pre_forum_post post table" and "Pre_forum_thread theme Table", of course, there are pictures and accessories datasheet, the following figure, a "attachment table" and "10 Attachment picture information table."
Annex table
Save all of the contents into SQL data as above.
Next, "pre_forum_post post table" and "Pre_forum_thread topic table", the Picture Attachment data table has, still lacks? Yes, still lack of pictures, attachment files are not saved (Ps:mysql just save the image path address attachment), picture attachment file hidden in: Bbs\data\attachment\forum, so with a date folder inside.
Attachments folder
Next, the snapshot rolls back to the latest time data, a new section on the forum, the name of the plate called "I was mistakenly deleted", and record the FID as follows:
Plate FID
Open "pre_forum_post post table" and "Pre_forum_thread theme table", modify its field FID value, corresponding to the above image FID, batch Modify field Fid,sql statement is:
1
Update table name set field name = new value;
FID Field
The preparation has been completed, the following start to import data, in the forum to execute the SQL statement backstage, the following figure:
Partial SQL statements
When inserting data, if there is a " SQL Error primary key already exists ", it may be a start to delete data is not clean, export data duplication, because the data is now imported is "mistakenly deleted data."
Finally upload the pictures and attachments to the server, open the post will find the picture attachment or not show, just click the "edit" on the show! Specific reasons why, may be PHP is required to refresh the browser to execute the Language bar!
The data of the forum is restored!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.