Creating a completely seperate 'test' forum for testing your hacks and mods.

By Brook · Jun 19, 2005 ·
  1. Brook
    As with any live site, it's important to have a test area where you can safely test out any modifications or hacks without risking them 'killing' your live site, either it's files, or worse, it's database.

    Hopefully by the end of this 'how-to' you will be able to create a completely seperate test forum on the same domain so that you can test out all your hacks and mods to your hearts content! I've created step-by-steps to make things as easy as possible but if anyone get's stuck anywhere please feel free to post a thread and highlight this article and which bit you are stuck on, and I'll do my best to help you. If I'm not around I'm sure someone else will do their best to help as we have a pretty friendly and helpful lot here on TAZ :p

    Although the article is a guide for vB, the same principles more or less apply to all forum software.

    I have included two main options; one where you can install a fresh new forum, and one where you can take a 'snapshot' of your existing forum and duplicate a copy of that. I have also written a couple of mini-guides, one that shows you how to create a new mysql database and one that shows you how to import/export styles...

    After all this you should have no excuse for not having a testing forum!! :)

    The Options in more detail...

    Option 1

    A clean fresh install of a brand new 'test forum'. This will be a basic clean install - just like how you first set up your forum, only in a different directory.

    SSH required?: No
    FTP required?: Yes
    Mysql Database required?: Yes


    Option 2

    A test forum based on a 'snapshot' of your existing one, including all it's current hacks, mods, styles and templates (basically an exact copy of your existing forum!) This is very useful and the preffered choice if you will be using the 'testing forum' for any hacks or mods that you will want to move to your 'live' forum at some stage.

    SSH required?: Yes
    FTP required?: Yes
    Mysql Database required?: Yes


    Mini-guide 1


    Creating a new mysql database using Cpanel - You'll need to create a brand new mysql database with both the above options, so here's a quick guide for anyone whos unsure on how to do that.


    Mini-guide 2

    Copying styles - Quick guide on how to copy/duplicate a style.

    ============================================================================================

    Option 1

    A clean fresh install of a brand new 'test forum'. This will be a basic clean install - just like how you first set up your forum, only in a different directory.

    SSH required?: No
    FTP required?: Yes
    Mysql Database required?: Yes



    #-------------
    # STEP ONE:
    #-------------


    Download the latest files from the customer area of vBulletin.com, or if you want to use the same version as your current forum, locate those.


    #------------
    # STEP TWO:
    #------------


    Log into your hosting account via FTP and create a directory for the test forum. Name this: testvb


    #------------
    # STEP THREE:
    #------------


    Using your FTP program, upload all of the files from STEP ONE into the folder you just created in STEP TWO



    #------------
    # STEP FOUR:
    #------------


    See Mini-guide 1 on how to create a new MYSQL database, when you've done that (and made a note of the details), come back and go to the next step.


    #-------------
    # STEP FIVE:
    #-------------


    On your local computer, open up the file /includes/config.php.new

    > add the details you just got from STEP FOUR then save the file.

    > rename the file to config.php and upload it to the includes folder.


    #-------------
    # STEP SIX:
    #-------------


    Go to:

    http://www.yourdomain.com/testvb/install/install.php
    (replace yourdomain.com with your domain name)

    And follow the onscreen instructions

    (when it asks you for the cookie domain: make sure you specify the folder /testvb)


    #-------------
    # Done!
    #-------------


    Done! You have set up a test forum!!

    If for some reason you can't log-in, it might be because of a cookie conflict, simply clear your cookies and cache and re-try.

    ============================================================================================

    Option 2

    A test forum based on a 'snapshot' of your existing one, including all it's current hacks, mods, styles and templates (basically an exact copy of your existing forum!) This is very useful and the preffered choice if you will be using the 'testing forum' for any hacks or mods that you will want to move to your 'live' forum at some stage.

    SSH required?: Yes
    FTP required?: Yes
    Mysql Database required?: Yes


    #-------------
    # STEP ONE:
    #-------------


    In your vB Admin Control Panel (ACP)

    vBulletin Options > Turn Your vBulletin On and Off

    > Forum Active

    > Click on: NO

    > Reason For Turning Forum Off

    Enter a reason such as:

    HTML:
    <p>Hi All - We're just carrying out a back-up.</p>
    <p>The forum will be offline for around 10 minutes or so - will be as fast as we can!. Sorry for any inconvenience. </p>
    
    > click on SAVE


    #------------
    # STEP TWO:
    #------------


    In your vB Admin Control Panel (ACP)

    vBulletin Options > Cookies and HTTP Header Options > Path to Save Cookies

    Make a note of the existing setting (for example mine is set to: /myforums/ )

    Then change the setting to:

    /

    > click on SAVE


    #------------
    # STEP THREE:
    #------------


    Log in to your server via SSH

    Type the following:

    mysqldump --opt -u databaseuser -p databasename > /path/to/backupname.sql

    Replace databaseuser with the Username for that database
    Replace databasename with the Database Name
    Replace /path/to/backupname.sql with the path that you wish to save your back up to (and make a note of it).

    You will be asked for a password. Type it in and press Enter. Your database will be backed up.
    (Incidently this is also a good way to make backups of your database - always remb to turn the forums of first tho)



    #------------
    # STEP FOUR:
    #------------


    In your vB Admin Control Panel (ACP)

    vBulletin Options > Cookies and HTTP Header Options > Path to Save Cookies

    Revert back to what your original setting was: (mine was: /myforums/ )


    #-------------
    # STEP FIVE:
    #-------------


    In your vB Admin Control Panel (ACP)

    vBulletin Options > Turn Your vBulletin On and Off

    > Forum Active

    > Click on: YES

    > click on SAVE


    #-------------
    # STEP SIX:
    #-------------


    > FTP to your site and copy all your files from your current fourms directory/folder to your PC.

    > Once copied rename that folder on your PC to: testvb
    (the test forum will be located at www.yoursite.com/testvb)

    HINT: make sure your ftp program is set to copy 'hidden' files such as .htacces (if you have any)


    #-------------
    # STEP SEVEN:
    #-------------


    Use the Mini-guide 1 to create a new mysql database - when done come back and follow the next step.


    #-------------
    # STEP EIGHT:
    #-------------


    Log in to your server via SSH

    Type the following:

    mysql -u databaseuser -p databasename < /path/to/backupname.sql

    Replace databaseuser with the NEW User that you just created in STEP SEVEN
    Replace databasename with NEW Database Name you just created in STEP SEVEN
    Replace /path/to/backupname.sql with the path that was previously saved to as in STEP THREE.

    You will be asked for a password. Type in the NEW password as created in STEP SEVEN and press Enter. Your snapshot will then be saved.


    #-------------
    # STEP NINE:
    #-------------


    Ok in the files you FTP'd in STEP SIX go to and open:

    > Includes > config.php

    > Then enter the details you used in STEP SEVEN, ie the:

    database name
    database user
    password

    > Save and exit file


    #-------------
    # STEP TEN:
    #-------------


    > FTP back to your site and copy the folder you renamed to testvb, along with all its contents (from STEP SIX) into your root directory. WARNING: if you have not renamed this folder, it will overwrite your existing files!

    HINT: make sure your ftp program is set to copy 'hidden' files such as .htacces (if you have any)
    HINT: You can alternatively copy the files using your ftp client from one directory to another, meaning you can bypass STEP SIX but not all servers/ftp programs allows this.


    #-------------
    # STEP ELEVEN:
    #-------------


    OK almost done!

    > go to your NEW forum, so:

    www.yoursite.com/your-test-forum-name ('your-test-forum-name' as specified in STEP SIX)

    > In vB Admin Control Panel (ACP)

    > vBulletin Options > Cookies and HTTP Header Options > Path to Save Cookies

    change to:

    /testvb/

    > click on SAVE

    #-------------
    # DONE:
    #-------------



    Congratulations you now have a duplicate of your forum!

    ==============================================================================================

    Mini-guide 1

    Creating a new mysql database using Cpanel - You'll need to create a brand new mysql database with both the above options, so here's a quick guide for anyone whos unsure on how to do that.


    #-------------
    # STEP ONE:
    #-------------


    Log into your Cpanel account


    #-------------
    # STEP TWO:
    #-------------


    Click on MYsql Databases


    #-------------
    # STEP THREE:
    #-------------


    Where it says 'Add Db' enter a name, say for example: testvb

    > Then click on 'Add Db'

    > then click on 'go back' (or go back to the main mysql screen)



    #-------------
    # STEP FOUR:
    #-------------


    Wwhere it says 'Add User' enter a username and password (and make a note of them)

    > click on 'Add User'


    #-------------
    # STEP FIVE:
    #-------------


    Towards the top it will have an area where it says:

    User [drop down] Db[drop down]

    In the drop downs for each of those options choose the new user and new database name you just created in STEP THREE and STEP FOUR.

    > under the bit 'privileges' click on 'All'

    > click on 'Add user to Db'



    #-------------
    # DONE:
    #-------------


    Done - you have succefully created a new database!

    ===============================================================================================

    Mini-guide 2

    Copying styles - Quick guide on how to copy/duplicate a style.



    #-------------
    # STEP ONE:
    #-------------


    log into your Admin Control Panel (ACP) and go to: Styles & Templates > Download / Upload Styles



    #-------------
    # STEP TWO:
    #-------------


    In the drop down menu Style, choose the style you want to duplicate and whether you want to: Get customizations made in this style and all parent styles, or not (I normally do) > then click on: Download.



    #-------------
    # STEP TWO:
    #-------------


    Once the style has been downloaded onto your PC, open it up your text editor and the second or third line should say something like:

    <style name="mystyle1" vbversion="3.0.7" type="custom">

    Change where it says 'mystyle1' to a new name such as 'mystyle1fortesting'

    Then save the file and exit



    #-------------
    # STEP THREE:
    #-------------


    Back to your ACP, (this will probably be on your test forum now right? ;)) go to: Styles & Templates > Download / Upload Styles



    #-------------
    # STEP FOUR:
    #-------------


    Where it says 'Import Style XML File' use the 'choose' button to locate the file on your hard-disk. Change any of the other settings is you wish, then click on IMPORT.


    #-------------
    # DONE:
    #-------------



    You now have a duplicate style you can play around with to your hearts content.

    Share This Article

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.