Copy forums but not posts

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Ideas Centre
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
slobadog
Registered User
Posts: 20
Joined: Thu Jun 14, 2007 5:13 am

Copy forums but not posts

Post by slobadog »

I'd like to copy all forums and sub-forums via phpmyadmin to set up a new board based on the old one. However I don't want all the posts included. I have tried simply backing up from admin the forums table (and importing to the new database), they all appear in admin under "Forums" but they don't appear on the index page. It says ...has no forums.
Any tips?

Thanks!
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72375
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Copy forums but not posts

Post by KevC »

You need to move everything and then delete what you don't want.

Transferring Your Board to a New Host or Domain
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
slobadog
Registered User
Posts: 20
Joined: Thu Jun 14, 2007 5:13 am

Re: Copy forums but not posts

Post by slobadog »

Thanks Kevin, I tried that but the sql backup was 75mb, bit large to manage easily. It has 52,500 posts.
I don't want to move the site, I'm starting a new one based on the old one (which is still active).
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72375
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Copy forums but not posts

Post by KevC »

75Mb is nothing in terms of databases.
That article explains how to restore large ones. Bigdump does it just fine.

You can't just take certain bits. Lots of tables are interconnected so you have to take it all and then delete the posts afterwards.
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
User avatar
DionDesigns
Registered User
Posts: 515
Joined: Sun Feb 26, 2012 11:22 pm
Location: Uncertain due to momentum.
Contact:

Re: Copy forums but not posts

Post by DionDesigns »

slobadog wrote:I have tried simply backing up from admin the forums table (and importing to the new database), they all appear in admin under "Forums" but they don't appear on the index page. It says ...has no forums.
Copying the forums in that manner creates the forums, but there are no permissions associated with the forums, and their topic/post/lastpost data will be incorrect.

Once you create the permissions, the forums will appear as they should. And once you sync the forums, the topic/post/lastpost data will be be correct as well.
slobadog
Registered User
Posts: 20
Joined: Thu Jun 14, 2007 5:13 am

Re: Copy forums but not posts

Post by slobadog »

I've spent a day messing with this. It now works for guests but as soon as I log in it throws:
General Error
SQL ERROR [ mysqli ]

[0]

An SQL error occurred while fetching this page. Please contact the ... Administrator if this problem persists.

I have copied over all the groups tables. I have used support toolkit to clean, sanitize and reset everything. I've synced everything and cleared out the cache. I've registered new users and administrators and tried logging in as them.

Admin is blank (can't log in).

What am I missing?
Ta!
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72375
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Copy forums but not posts

Post by KevC »

Copy everything.
Delete what you don't want.
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
slobadog
Registered User
Posts: 20
Joined: Thu Jun 14, 2007 5:13 am

Re: Copy forums but not posts

Post by slobadog »

LOL! You did say that already. Do I really have to go through and delete 52,500 posts or can I just dump the posts table and re-sync?
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72375
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Copy forums but not posts

Post by KevC »

You can set the topics per page to be something manageable like 500 and delete whole pages at once. That's 500 topics, which would be more than that in posts. It doesn't take long to delete that many.
You can also use the forum prune option to remove all posts older than 1 day for instance.

You could have done it by now. I've cleaned up a spamridden forum with over 100,000 posts in 4 hours before. It doesn't take that long.
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
slobadog
Registered User
Posts: 20
Joined: Thu Jun 14, 2007 5:13 am

Re: Copy forums but not posts

Post by slobadog »

Did I say 75mb? I should have said 751mb. It took 5.5 hours to upload the backup but thanks to you Kevin, all working now.

I'm having a look at viewtopic.php?f=70&t=2160370 which aims to implement multi forums on the same database, looks like it might work for me...

Thanks for your help, much appreciated!
Locked

Return to “[3.0.x] Support Forum”