Restore phpbb_forums

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
tabor
Registered User
Posts: 82
Joined: Wed Feb 05, 2003 1:42 am

Restore phpbb_forums

Post by tabor »

Hello,
I deleted phpbb_forums table by accident now my forum is not working anymore. It seems all datas gone. There has anyway I can have them back? If someone know please guide. Thanks in advance.
User avatar
Phil
Former Team Member
Posts: 10403
Joined: Sat Nov 25, 2006 4:11 am
Name: Phil Crumm
Contact:

Re: Restore phpbb_forums

Post by Phil »

Do you have a database backup?
Moving on, with the wind. | My Corner of the Web
tabor
Registered User
Posts: 82
Joined: Wed Feb 05, 2003 1:42 am

Re: Restore phpbb_forums

Post by tabor »

iWisdom,
I don't have a backup. There has any ways to find informations back in different tables even I do it manually? because I still have the rest.
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 51456
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Restore phpbb_forums

Post by stevemaury »

Not sure this will work, but at this point you have nothing to lose by trying.

If you know what the forum_id was of all the forums, and their names, you could recreate them in the ACP and then use phpMyAdmin to manually edit each forum to give it its old id #. I do not believe you would have to change the newly created category ids in the database when you recreate the forums and categories. You will also have to manually fill in the values for forum_topics and forum_last_post_id

But first, you will have to recreate the forums table. This SQL will do that. If your table prefix is not phpbb_, change that before you run the query.

Code: Select all

CREATE TABLE phpbb_forums (
   forum_id smallint(5) UNSIGNED NOT NULL,
   cat_id mediumint(8) UNSIGNED NOT NULL,
   forum_name varchar(150),
   forum_desc text,
   forum_status tinyint(4) DEFAULT '0' NOT NULL,
   forum_order mediumint(8) UNSIGNED DEFAULT '1' NOT NULL,
   forum_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
   forum_topics mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
   forum_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
   prune_next int(11),
   prune_enable tinyint(1) DEFAULT '0' NOT NULL,
   auth_view tinyint(2) DEFAULT '0' NOT NULL,
   auth_read tinyint(2) DEFAULT '0' NOT NULL,
   auth_post tinyint(2) DEFAULT '0' NOT NULL,
   auth_reply tinyint(2) DEFAULT '0' NOT NULL,
   auth_edit tinyint(2) DEFAULT '0' NOT NULL,
   auth_delete tinyint(2) DEFAULT '0' NOT NULL,
   auth_sticky tinyint(2) DEFAULT '0' NOT NULL,
   auth_announce tinyint(2) DEFAULT '0' NOT NULL,
   auth_vote tinyint(2) DEFAULT '0' NOT NULL,
   auth_pollcreate tinyint(2) DEFAULT '0' NOT NULL,
   auth_attachments tinyint(2) DEFAULT '0' NOT NULL,
   PRIMARY KEY (forum_id),
   KEY forums_order (forum_order),
   KEY cat_id (cat_id),
   KEY forum_last_post_id (forum_last_post_id)
);
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
tabor
Registered User
Posts: 82
Joined: Wed Feb 05, 2003 1:42 am

Re: Restore phpbb_forums

Post by tabor »

Stevemaury,

Thanks for helping me!
I have created forums table as you guide above. I still remember their name and their old id but I don't know about forum_topics and forum_last_post_id so on (there has a lot of fields). And how can I have all posts back to each of their own forum?
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 51456
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Restore phpbb_forums

Post by stevemaury »

If you set the forum_id of the newly created forums back to their old value, the posts table's forum_id will now match. For the forum_topics value, you will have to count the number of topics in a forum and set the value to that number. For the forum_last_post_id, you will have to look at the dates of all the posts to find the last one and then get the id of the post and set that value in forums_last_post_id.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
tabor
Registered User
Posts: 82
Joined: Wed Feb 05, 2003 1:42 am

Re: Restore phpbb_forums

Post by tabor »

stevemaury,

Some forums are showing 3 threads, some are showing just one. I think it because I couldn't get the right forum_posts, forum_topics and forum_last_post_id. Do you know what table so I can to find those numbers?
Locked

Return to “2.0.x Support Forum”