PDA

View Full Version : How to delete all posts and forums?


romaine
11-04-2017, 02:09 PM
I restored a vB 4 on a different hosting to test and I want to delete all posts and forums there but keeping members but the problem is I want to have new posts or forums that like a clean forum does, i.e

forum id starts from 1
post id starts from 1

I am thinking about empty forums and posts table in Phpmyadmin but I don't know that's possible or not because I think vBulletin table has relationships together so If I delete them, maybe cause some conflicts on forum?

Please advise me. Thanks!

Dave
11-04-2017, 02:10 PM
I don't see why you would want to start from 1 again but the only way to achieve this is to execute
TRUNCATE TABLE tablename;
queries against all tables that have relationships with the post, thread and forum tables.
This will clear the data and reset the seed.

aycan555
11-04-2017, 03:18 PM
If you dont want any conflicts, just install fresh one, and export only members from old database and import it to new one ..

romaine
11-04-2017, 03:26 PM
I don't see why you would want to start from 1 again but the only way to achieve this is to execute
TRUNCATE TABLE tablename;
queries against all tables that have relationships with the post, thread and forum tables.
This will clear the data and reset the seed.

It is just an example for what I want like a fresh forum because id of posts and forums on my forum are pretty big, like 85323 or 93232...etc If members continue posting then it will generate big numbers like that.

If you dont want any conflicts, just install fresh one, and export only members from old database and import it to new one ..

That's why I asked this question, I am using vB 4.25 and PHP 7 thus I could not use Impex to import members on a fresh forum.

Dave
11-04-2017, 03:58 PM
Is it that big of a problem to see numbers like that?
At some point it will reach that number again anyway.

final kaoss
11-04-2017, 04:13 PM
It is just an example for what I want like a fresh forum because id of posts and forums on my forum are pretty big, like 85323 or 93232...etc If members continue posting then it will generate big numbers like that.



That's why I asked this question, I am using vB 4.25 and PHP 7 thus I could not use Impex to import members on a fresh forum.

If you're worried about this affecting performance, don't worry, it will do no such thing. To truncate them just because you see the numbers getting larger is just paranoia. As stated, those numbers will keep growing with each post, so there's no real point in worrying about it.

Oh and I forgot to mention that by truncating them, you also run the risk of breaking internal links that your members may have linked to in threads.

romaine
11-05-2017, 12:23 AM
Is it that big of a problem to see numbers like that?
At some point it will reach that number again anyway.

It is not a big problem to see numbers like that but it is my requirement to have new ids on a new forum.

Yeh I think even truncate a table can not solve the problem because it has relations between tables

If you're worried about this affecting performance, don't worry, it will do no such thing. To truncate them just because you see the numbers getting larger is just paranoia. As stated, those numbers will keep growing with each post, so there's no real point in worrying about it.

Oh and I forgot to mention that by truncating them, you also run the risk of breaking internal links that your members may have linked to in threads.

You are right, truncate a table can not help to posts or forums have new ids like on a fresh forum.