A way to copy forums

Support for IntegraMOD 141

Moderator: Integra Moderator

A way to copy forums

PostAuthor: tc1967uk » Fri Feb 09, 2007 12:30 pm

Your phpBB Version: 2.0.22
phpBB Type: phpBB / IMPortal
MODs: No
Your knowledge: Beginner
Board URL: [url]http://[/url]

PHP Version:
MySQL Version:


What was done before the problem appeared?



What was done to try to solve the problem?




De.scription and Message

Is there any way to copy forums (or even better multiple forums)?

I have several regional categories, and would like the same type of forums for each, but would prefer not to have to recreate all forums for each category.

Is there any way to do this?
Last edited by tc1967uk on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
He's dead, Jim. You take his Tricorder, I'll grab his wallet

tc1967uk
Members
Members
 
Posts: 39
Likes: 0 post
Liked in: 0 post
Joined: Sun Oct 22, 2006 10:53 pm
Cash on hand: 0.00

PostAuthor: Leadfoot » Fri Feb 09, 2007 4:00 pm

I take it you are currently running 140?
Last edited by Leadfoot on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

Leadfoot
Integra Member
Integra Member
 
Posts: 131
Likes: 0 post
Liked in: 0 post
Joined: Sun Oct 01, 2006 5:02 pm
Cash on hand: 0.00

PostAuthor: Leadfoot » Fri Feb 09, 2007 5:17 pm

I just made this maybe this will help

http://www.integramod.com/forum/viewtop ... 1690#21690
Last edited by Leadfoot on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

Leadfoot
Integra Member
Integra Member
 
Posts: 131
Likes: 0 post
Liked in: 0 post
Joined: Sun Oct 01, 2006 5:02 pm
Cash on hand: 0.00

Re: A way to copy forums

PostAuthor: Helter » Fri Feb 09, 2007 7:36 pm

you can copy/paste and edit them and insert them directly into your db via phpmyadmin

example
make all your catagories first. Export your table "phpbb_catagories" to get the catagory id #
In this example, I have two catagory's. The catagory id #'s are the second #'s after "VALUES" youll have to edit the catagory and forum id #'s, forum names, etc...

Be sure to first export your original phpbb_forums, in case of an error. When your done, go to acp and resync the forums to add the new forum info to def_tree.php

Code: Select all
INSERT INTO `phpbb_forums` VALUES (1, 1, 'Test Forum 1', '', 0, 20, 0, 0, 0, NULL, 0, 0, 0, 1, 1, 1, 1, 3, 3, 5, 1, 1, 3, 0, 3, '', 0, 0, 0, '', 'c', 3, 3, 5, 1, 3);INSERT INTO `phpbb_forums` VALUES (2, 1, 'Test Forum 2', '', 0, 30, 0, 0, 0, NULL, 0, 0, 0, 1, 1, 1, 1, 3, 3, 5, 1, 1, 3, 0, 3, '', 0, 0, 0, '', 'c', 3, 3, 5, 1, 3);INSERT INTO `phpbb_forums` VALUES (3, 2, 'Test Forum 1', '', 0, 50, 0, 0, 0, NULL, 0, 0, 0, 1, 1, 1, 1, 3, 3, 5, 1, 1, 3, 0, 3, '', 0, 0, 0, '', 'c', 3, 3, 5, 1, 3);INSERT INTO `phpbb_forums` VALUES (4, 2, 'Test Forum 2', '', 0, 60, 0, 0, 0, NULL, 0, 0, 0, 1, 1, 1, 1, 3, 3, 5, 1, 1, 3, 0, 3, '', 0, 0, 0, '', 'c', 3, 3, 5, 1, 3); Ā 


VALUES

[table]
[mrow color=#81A7E8]Field[mcol color=#81A7E8]type[mcol color=#81A7E8]Collation[mcol color=#81A7E8]attributes[mcol color=#81A7E8]Null[mcol color=#81A7E8]Default
[row][col][col][col][col][col]
[row]forum_id[col]smallint(5)[col][col]UNSIGNED[col]No[col]0
[row]cat_id[col]mediumint(8)[col][col]UNSIGNED[col]No[col]0
[row]forum_name[col]varchar(150)[col]latin1_swedish_ci[col][col]Yes[col]NULL
[row]forum_desc[col]text[col]latin1_swedish_ci[col][col]Yes[col]NULL
[row]forum_status[col]tinyint(4)[col][col][col]No[col]0
[row]forum_order[col]mediumint(8)[col][col]UNSIGNED[col]No[col]1
[row]forum_posts[col]mediumint(8)[col][col]UNSIGNED[col]NO[col]0
[row]forum_topics[col]mediumint(8)[col][col]UNSIGNED[col]No[col]0
[row]forum_last_post_id[col]mediumint(8)[col][col]UNSIGNED[col]No[col]0
[row]prune_next[col]int(11)[col][col][col]Yes[col]NULL
[row]prune_enable[col]tinyint(1)[col][col][col]No[col]0
[row]auth_view[col]tinyint(2)[col][col][col]No[col]0
[row]auth_read[col]tinyint(2)[col][col][col]No[col]0
[row]auth_post[col]tinyint(2)[col][col][col]No[col]0
[row]auth_reply[col]tinyint(2)[col][col][col]No[col]0
[row]auth_edit[col]tinyint(2)[col][col][col]No[col]0
[row]auth_delete[col]tinyint(2)[col][col][col]No[col]0
[row]auth_sticky[col]tinyint(2)[col][col][col]No[col]0
[row]auth_announce[col]tinyint(2)[col][col][col]No[col]0
[row]auth_global_announce[col]tinyint(2)[col][col][col]No[col]0
[row]auth_vote[col]tinyint(2)[col][col][col]No[col]0
[row]auth_pollcreate[col]tinyint(2)[col][col][col]No[col]0
[row]auth_attachments[col]tinyint(2)[col][col][col]No[col]0
[row]auth_download[col]tinyint(2)[col][col][col]No[col]0
[row]auth_news[col]tinyint(2)[col][col][col]No[col]2
[row]forum_link[col]varchar(255)[col]latin1_swedish_ci[col][col]Yes[col]NULL
[row]forum_link_internal[col]tinyint(1)[col][col][col]No[col]0
[row]forum_link_hit_count[col]tinyint(1)[col][col][col]No[col]0
[row]forum_link_hit[col]bigint(20)[col][col]UNSIGNED[col]No[col]0
[row]icon[col]varchar(255)[col]latin1_swedish_ci[col][col]Yes[col]NULL
[row]main_type[col]char(1)[col]atin1_swedish_ci[col][col]Yes[col]NULL
[row]auth_cal[col]tinyint(2)[col][col][col]No[col]0
[row]auth_ban[col]tinyint(2)[col][col][col]No[col]3
[row]auth_greencard[col]tinyint(2)[col][col][col]No[col]5
[row]auth_bluecard[col]tinyint(2)[col][col][col]No[col]1
[row]auth_delayedpost[col]tinyint(4)[col][col][col]No[col]3
[/table]
Last edited by Helter on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
"Success is getting what you want. Happiness is wanting what you get." - Dale Carnegie
User avatar
Helter
Administrator
Administrator
 
Posts: 4554
Likes: 40 posts
Liked in: 116 posts
Images: 0
Joined: Sat Mar 11, 2006 4:46 pm
Cash on hand: 1,959.15
Location: Seattle Wa
IntegraMOD version: phpBB2x

Re: A way to copy forums

PostAuthor: tc1967uk » Tue Feb 20, 2007 11:51 pm

Thanks for the pointer HelterSkelter. This looks very complicated to a beginner like me. Can I ask for a breakdown please?

[list type=decimal][*]Be sure to first export your original phpbb_forums, in case of an error. - Should this be my forst step then? If so, do I do it via CPanel or a FTP or something else?[*]I've made all my initial categories. "Export your table "phpbb_catagories" to get the catagory id # " Do I do this in the same way as above?[*]I'll probably need more help once I've looked into your answers to 1+2 above. Hope you don't mind[/list]
Last edited by tc1967uk on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
He's dead, Jim. You take his Tricorder, I'll grab his wallet

tc1967uk
Members
Members
 
Posts: 39
Likes: 0 post
Liked in: 0 post
Joined: Sun Oct 22, 2006 10:53 pm
Cash on hand: 0.00

Re: A way to copy forums

PostAuthor: Helter » Wed Feb 21, 2007 12:28 am

this is the first of the 4 forum codes I posted

INSERT INTO `phpbb_forums` VALUES (1, 1, 'Test Forum 1', '', 0, 20, 0, 0, 0, NULL, 0, 0, 0, 1, 1, 1, 1, 3, 3, 5, 1, 1, 3, 0, 3, '', 0, 0, 0, '', 'c', 3, 3, 5, 1, 3);

most of these fields will remain the same for your purposes. The ones youll have to edit are the first 3 or 4 and the 6th

INSERT INTO `phpbb_forums` VALUES (1, 1, 'Test Forum 1', '', 0, 20, 0, 0, 0, NULL, 0, 0, 0, 1, 1, 1, 1, 3, 3, 5, 1, 1, 3, 0, 3, '', 0, 0, 0, '', 'c', 3, 3, 5, 1, 3);

the fields are described in the lower section of the post

ie... INSERT INTO `phpbb_forums` VALUES (1, 1, 'Test Forum 1', '', 0, 20, 0, 0, 0, NULL, 0, 0, 0, 1, 1, 1, 1, 3, 3, 5, 1, 1, 3, 0, 3, '', 0, 0, 0, '', 'c', 3, 3, 5, 1, 3);

this is the forum id. You will need to increment this by one for every forum

INSERT INTO `phpbb_forums` VALUES (1, 1, 'Test Forum 1', '', 0, 20, 0, 0, 0, NULL, 0, 0, 0, 1, 1, 1, 1, 3, 3, 5, 1, 1, 3, 0, 3, '', 0, 0, 0, '', 'c', 3, 3, 5, 1, 3);

this is the catagory id. You can get the catagory id by looking in phpbb_catagories in your db

INSERT INTO `phpbb_forums` VALUES (1, 1, 'Test Forum 1', '', 0, 20, 0, 0, 0, NULL, 0, 0, 0, 1, 1, 1, 1, 3, 3, 5, 1, 1, 3, 0, 3, '', 0, 0, 0, '', 'c', 3, 3, 5, 1, 3);

this is your forum name

INSERT INTO `phpbb_forums` VALUES (1, 1, 'Test Forum 1', '', 0, 20, 0, 0, 0, NULL, 0, 0, 0, 1, 1, 1, 1, 3, 3, 5, 1, 1, 3, 0, 3, '', 0, 0, 0, '', 'c', 3, 3, 5, 1, 3);

forum de.scription goes here if you have one

INSERT INTO `phpbb_forums` VALUES (1, 1, 'Test Forum 1', '', 0, 20, 0, 0, 0, NULL, 0, 0, 0, 1, 1, 1, 1, 3, 3, 5, 1, 1, 3, 0, 3, '', 0, 0, 0, '', 'c', 3, 3, 5, 1, 3);

forum order. Increment by 10 for every forum
Last edited by Helter on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
"Success is getting what you want. Happiness is wanting what you get." - Dale Carnegie
User avatar
Helter
Administrator
Administrator
 
Posts: 4554
Likes: 40 posts
Liked in: 116 posts
Images: 0
Joined: Sat Mar 11, 2006 4:46 pm
Cash on hand: 1,959.15
Location: Seattle Wa
IntegraMOD version: phpBB2x

Re: A way to copy forums

PostAuthor: tc1967uk » Wed Feb 21, 2007 8:58 am

Sorry HelterSkelter, still too fast for me, I want start with your first 2 steps:

[list type=decimal][*]"export your original phpbb_forums, in case of an error". - What is the best way to do this, and where are the files I need to back up?[*]"Export your table "phpbb_catagories" to get the catagory id # " - How do I do this and where are they?[/list]

I'm ok with computers, but a total dunce when it comes to BBs and php...
Last edited by tc1967uk on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
He's dead, Jim. You take his Tricorder, I'll grab his wallet

tc1967uk
Members
Members
 
Posts: 39
Likes: 0 post
Liked in: 0 post
Joined: Sun Oct 22, 2006 10:53 pm
Cash on hand: 0.00

Re: A way to copy forums

PostAuthor: Helter » Wed Feb 21, 2007 12:34 pm

they are in your database. You can see them using phpmyadmin. If your not familiar with phpmyadmin, or your db fields, it will probably be faster and much safer to add the forums from the acp one at a time
Last edited by Helter on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
"Success is getting what you want. Happiness is wanting what you get." - Dale Carnegie
User avatar
Helter
Administrator
Administrator
 
Posts: 4554
Likes: 40 posts
Liked in: 116 posts
Images: 0
Joined: Sat Mar 11, 2006 4:46 pm
Cash on hand: 1,959.15
Location: Seattle Wa
IntegraMOD version: phpBB2x

Re: A way to copy forums

PostAuthor: tc1967uk » Wed Feb 21, 2007 12:44 pm

I've had a look at phpbbmyadmin, and can see the structure of phpbb_forums and also browsed the data, but can't see the edit option.

I'd like to try to do it, to learn and to grow in knowledge, even if it's only to copy 1 category and a forum at first.

If you can tell me how to back up phpbb_forums and phpbb_categories, plus how to edit them, I'll give it a try.

PS, I've backed the database up via General Admin/backup DB just in case.....
Last edited by tc1967uk on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
He's dead, Jim. You take his Tricorder, I'll grab his wallet

tc1967uk
Members
Members
 
Posts: 39
Likes: 0 post
Liked in: 0 post
Joined: Sun Oct 22, 2006 10:53 pm
Cash on hand: 0.00

Re: A way to copy forums

PostAuthor: Helter » Wed Feb 21, 2007 3:34 pm

to back up specific tables open phpmyadmin and click on the name of your db

in the top menu, click on export

in the left of the center window, you will see a list of your tables.

highlight the tables you wish to download. to select more than one, hold the ctrl button as you click on them

scroll to the bottom, check the box "save as file"

you should see __DB__ already in the title box. You can add to the begining of this to remember which tables these are. example backed_up_forums_table__DB__

dont use compression unless you have a huge db, so you can edit this in "ms word"

make a copy of it to use to make your edits, but put the original in a safe place in case you need to restore it



When youve edited the file to your satisfaction, go to phpmyadmin again

click on your db name

in the center window, select the tables your going to replace.

scroll to the bottom. In the box that says "With Selected", change to "Drop"

Remember that when you choose "Go" ALL selected tables will be deleted

Now go back to the top and choose "Import"

browse to your edited db file and choose "go"

Now go to your forum acp and choose resync. if all goes well, you should have your new forums. if not

drop these same tables and import the file you originally saved and you will be back where you started
Last edited by Helter on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
"Success is getting what you want. Happiness is wanting what you get." - Dale Carnegie
User avatar
Helter
Administrator
Administrator
 
Posts: 4554
Likes: 40 posts
Liked in: 116 posts
Images: 0
Joined: Sat Mar 11, 2006 4:46 pm
Cash on hand: 1,959.15
Location: Seattle Wa
IntegraMOD version: phpBB2x


Return to IntegraMOD 141

Who is online

Registered users: App360MonitorBot, Bing [Bot], Google [Bot]