• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.1 How to copy a mature xF to a dev site

ForestForTrees

Well-known member
#1
Hello,

I think that our license allows us to set up a development xenForo site. Is there a recommended way of copying your current forum to a dev environment? My motivation is that I'm about to upgrade from xF 1.1.2 to the current version, and I want an exact duplicate of the current site on a subdomain so that I can practice and test there.

I was thinking of setting up a subdomain in cPanel and then moving the entire xenForo file hierarchy and MySQL database over from the main site. With both database and files, theoretically, we should be good to go. But what about if the domain name or the name of our production database is hardcoded in the files or database?

Is there a recommended way of handling this?

Thanks.
 

Brogan

XenForo moderator
Staff member
#2
Copy the files and database to the test environment.
Update the board url in the acp.
Edit library\config.php with the new database information, and any cache or cookie specific data.

This would be an example config.php
PHP:
<?php

$config['db']['host'] = 'localhost';
$config['db']['port'] = '3306';
$config['db']['username'] = 'username';
$config['db']['password'] = 'password';
$config['db']['dbname'] = 'database';

$config['superAdmins'] = '1,2';

$config['enableMail'] = false;

$config['cookie'] = array(
'prefix' => 'mydomaintest_',
'path' => '/',
'domain' => ''
);

$config['debug'] = true;
 

ForestForTrees

Well-known member
#3
Thanks so much, Brogan, that is very helpful.

For any noobs (like me) reading this, I'll be using Jake's backup and restore resource to move the databases. Specifically, I'll back up my main database, create a new database for the test forum, and restore the information from the main database into the new database. The result is that I have essentially copied all of the data to the test database. I plan to use cPanel to make the new database and will update this paragraph if that doesn't work.
Copy the files and database to the test environment.
Update the board url in the acp.
Edit library\config.php with the new database information, and any cache or cookie specific data.
Assuming that I don't have any cache or cookie changes to make, can I infer that if I stopped between steps 2 and 3, I could use the test and production forums simultaneously. Some ACP changes would only affect one instance, but others would be cloned between the two forums via the shared database? Would doing this be safe? I'm not hoping for a precise answer here, just in general terms. It weirds me out a little to visit the ACP and make changes before putting the new database info into config.php, so I'm hoping for a little reassurance.
 

ForestForTrees

Well-known member
#5
That's what I figured. To soothe my worrying mind, then, is it okay to update the board URL in the acp after I've edited config.php rather than before?