PDA

View Full Version : How to establish a test environment?


jluerken
Thu 22nd Jun '06, 9:50am
Hi members,

vB 3.6 beta3 is out and like many of you I want to start first tests.
Currently I am running the latest stable 3.5 release with many installed products and my own style.

Before I start the upgrade with the upgrade script I want to install a test environment.

This test environment will only be used from me.

What I need is a copy of my productive board where I can make upgrade tests.
I have thought about this many times and think creating one is a lot of work.

Maybe one of you has found a smart solution how to create a working copy of the actual system to test things out?

Anyone with an example or tutorial?

/jluerken

slappy
Thu 22nd Jun '06, 9:40pm
Part of the answer depends on what operating system your server is running. Here's one option, assuming you are running on Unix/linux:

First, you need FTP/SSL access to your server. In the directory where your forum is running, you need to create a new directory which you can give any name you want, but the easiest would be to put something on the end of the name of your current forum, e.g. current= /forum; new=/forum2.

Then, if you know how to use the cp (copy) command from the command line on the server you can make an exact copy of your current vbulletin/forum files into /forum2. This will become your test forum.

Now you need to create a new folder in the directory where your vbulletin database is currently running. Again it doesn't matter what you call this folder, just as long as you change the config.php file in the testforum/includes folder to point to the database in this "new" testdatabase folder and NOT your original database (or it will overwrite your production database :eek: ). Your config.php file in the test forum also MUST identify the testforum, by whatever name you used for it.

My original forum database is in /vbulletin and my test forum database is in /vbulletin2, but these can be whatever you used or want.

In Unix you must now CREATE DATABASE in this new, "test database" folder. This command is issued from the mysql> prompt (not the command line. ) It will create a single file in the test database folder named "db.opt" and make a mysql connection to that folder. After CREATE DATABASE you can do a SHOW DATABASE command and should see a listing of your databases, including the new testdatabase you just created.

Now you have to make a copy of your current database files and get them into your new "testdatabase folder." Again this can be done in several ways, but it probably should be done the same way you make a backup. In fact, one of the easiest ways would be to simply install a recent backup into the database with a

mysql -uUsername -pPassword testforumname < backupname.sql

instruction on the command line. If you know mysql commands this is fairly easy.

There is an important precaution I ran into in our own Board. Our backup script was written using the -B (or databasename) option. This puts the statement:

-- Current Database: `vbulletin`

--CREATE DATABASE /*!32312 IF NOT EXISTS*/ `vbulletin` /*!40100 DEFAULT CHARACTER SET latin1 */;

USE `vbulletin`;

at the top of the backup file and it will overwrite your vbulletin database, no matter what database you tell it to "restore."

To avoid this issue you can generally use the following mysql instruction to take an immediate backup from your current database file and deposit that backup file at root, and it will not have the CREATE DATABASE/USE DATABASE problem.

mysqldump --opt -q -p productiondatabasename > backupname.date.sql

The -p will prompt you for your mysql password. You may also need the -uUsername option before the -p option, to identify your mysql username.

Now, from the root directory and at the mysql> prompt you can use:

mysql -p testdatabasename < backupname.date.sql

and you will have an exact copy of your current production database in the new testdatabase.

Now you upload the upload folder contents from your test version of vbulletin, containing the config.php file pointing to the testforum and testdatabase.

The rest is a simple UPGRADE of the testforum to whatever version you are "testing." You would access the test forum the same way you access your current forum, except the PATH in the browser has to identify the testforumname, instead of the forumname. I would put an .htaccess file on the testforum to prevent public access. It's easier than changing all the usergroup permissions in your current setup.

Final precaution, you should probably disable all your plugins from the admincp before you attempt to upgrade, or to temporarily disable the plugin system, edit config.php and add this line right under <?php

define('DISABLE_HOOKS', true);

otherwise your v3.6.0 Beta upgrade will probably fail in several places.

After the upgrade, you will see a listing of the templates which will need reverting. There is a neat [View History] button which will give you a side by side, color coded view of the "original" and "modified" code from you template and the "current" version, with color coding for things added to "your" template, things "removed" from your template in the current template and so on. See more on this feature here:

http://www.vbulletin.com/docs/html/stylemanager_compare_templates

This should give you a functional equilivent copy of your production forum with all your styles and mods to test. After running the upgrade, with the plugins off or commented out in config.php, you can remove the config.php statement and turn your plugins back on, one by one and see what works and what doesn't.

Regards,

jluerken
Fri 23rd Jun '06, 2:24am
Hi, thanks for the long and fast answer.
That about the urls in the database?

I think I also have to change all absolute and relative pathes there too or?

Example
http://www.forum.de to http://www.forum2.de and /home/forum to /home/forum2 or?

slappy
Fri 23rd Jun '06, 10:03am
You probably could get a mysql query to do that, but why would you need to do that if it is just a "test" forum where you are testing functionality of plugins and working/testing styles and things?

[EDIT] Unless, of course, the links are necessary for the plugins and mods!

Regards,

Tomdarkness
Sat 24th Jun '06, 7:22am
Dont you need to name the forum vbtest and password protect it if you are making a test forum? Or am I wrong.

slappy
Sat 24th Jun '06, 7:25am
You can name your test forum whatever you want to because it is required to be non-accessible to the public to comply with your license.

I also suggested that you put an .htaccess file on the forum, which IS "password protecting" the forum. ;)

Regards,

Colin F
Wed 28th Jun '06, 4:31am
It should be in a folder called /testvb/