Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Making a complete copy of a forum but without users & discussions?

How would I make a complete copy of my existing forum to be used on another website, with only the users, their PMs,discussions and Activity entries omitted?

Everything else should stay, so the whole configuration including the user roles setup and modules, template, categories setup, and what else.

Tagged:

Comments

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited October 2014

    ok, I would install vanilla elsewhere then copy over the relevant things you want to keep. You can copy over any settings you want from the old config.php however the database and all the other info would be new.

  • Options

    Can I copy the database over as well and clean out just tables regarding users, PMs, discussions and Activity, and how could that be done?

    I'm really not a database specialist, but I find my way around with phpMyAdmin, though I have no idea what can safely be deleted and what not, and if it's even worth it compared to just copying over the files, leave database fresh as is, and start replicating the whole configuration/setup manually.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Yes just create a new fresh instal with a new database and then copy over the things you want, you can copy the settings saved in config.php for plugins and such.

  • Options

    OK, thanks, I guess it is the easiest (or even only) way after all. ;)

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    There have been some similar questions recently on how to move an installation from localhost to webserver. You have to follow those steps and afterwards look through all tables. For each table that contains user content do a "TRUNCATE TableName;" SQL command that will "reset" the table - delete all contents and set autoindex back to 1.
    So "TRUNCATE Gdn_Discussion;" will delete all discussions and when you start a new discussion afterwards, it will have DiscussionID 1. If you only delete the contents of a table, the index will not be reset.

    Additionally, there are some rows in tables that you don't want to purge, that contain counters aand you will have to reset them manually. Gdn_Category (which you want to keep) has CountDiscussions and CountComments column, which must be set to 0. So look for "CountSomething" fields in the tables you don't touch.

    You should not simply use a fresh install and copy config.php to there, because when you enable plugins, they may or may not create or alter tables. This step is skipped when you simply write "Enabled=true" in config.

    Furthermore you've said you want to keep roles and categories. This information is stored in db only.

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    I've just you've asked how to copy the db... This is done via export and import and this could be done with phpMyAdmin

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    That should be quite comprehensive (and I might have included tables that you don't even have in you db because they have been generated in my db by some plugins that you do not use):

    truncate GDN_Activity;
    truncate GDN_ActivityComment;
    truncate GDN_Ban;
    truncate GDN_Comment;
    truncate GDN_Conversation;
    truncate GDN_ConversationMessage;
    truncate GDN_Discussion;
    truncate GDN_Draft;
    truncate GDN_Invitation;
    truncate GDN_Log;
    truncate GDN_Message;
    truncate GDN_Regarding;
    truncate GDN_Session;
    truncate GDN_Spammer;
    truncate GDN_User;
    truncate GDN_UserAuthentication;
    truncate GDN_UserAuthenticationNonce;
    truncate GDN_UserAuthenticationProvider;
    truncate GDN_UserAuthenticationToken;
    truncate GDN_UserCategory;
    truncate GDN_UserComment;
    truncate GDN_UserConversation;
    truncate GDN_UserDiscussion;
    truncate GDN_UserMerge;
    truncate GDN_UserMergeItem;
    truncate GDN_UserMeta;
    truncate GDN_UserPoints;
    
  • Options
    R_JR_J Ex-Fanboy Munich Admin

    In order to get the tables that might contain some old "count" information, you can use this query:

    SELECT DISTINCT TABLE_NAME 
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE COLUMN_NAME LIKE '%Count%'
    AND TABLE_SCHEMA='YourDatabaseName';
    
  • Options

    Thanks a lot, @R_J, that looks very good as well. I think I'll try a complete copy including the database and truncate, if for some reason that's not going to work out I can still go the other route with just copying the files and replicating the setup. :)

  • Options
    hgtonighthgtonight ∞ · New Moderator

    Just visit /dba/counts to fix the counts after manual database manipulation.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options
    peregrineperegrine MVP
    edited October 2014

    @MasterOne said:
    How would I make a complete copy of my existing forum to be used on another website, with only the users, their PMs,discussions and Activity entries omitted?

    Everything else should stay, so the whole configuration including the user roles setup and modules, template, categories setup, and what else.

    I wrote a plugin similar to cleanser, that will leave users but mass deletes discussions with 0 comments, and it leaves announcements.

    the model could easily be manually changed to delete all discussions regardless of comment count, discussions based on date, etc.

    If you want it, and promise to test it in a timely manner, I'll upload it. Offer good for two days!

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    @peregrine, yes please, I can try it on our test installation.

  • Options

    @MasterOne said:
    peregrine, yes please, I can try it on our test installation.

    http://vanillaforums.org/addon/massdiscussiondelete-plugin

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    @vrijvlinder said:

    actually that should be the icon for a few themes, use at your own risk if you don't understand css and want to change things.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Maybe that is a good idea for rating purposes. The radioactive hazardous waste icon/reaction...

    The community has voted, this add on is more hazardous than any community add-on which is already use at your own risk...

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Not sure what this has to do with anything but I find it very amusing ....

Sign In or Register to comment.