1. 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

Discussion in 'Installation, Upgrade, and Import Support' started by ForestForTrees, Nov 24, 2013.

  1. ForestForTrees

    ForestForTrees Well-Known Member

    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.
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    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 and xf_phantom like this.
  3. ForestForTrees

    ForestForTrees Well-Known Member

    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.
    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.
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    The database details in config.php must be different.
    Having two different installations writing to the same database is a recipe for disaster.
     
    ForestForTrees and xf_phantom like this.
  5. ForestForTrees

    ForestForTrees Well-Known Member

    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?
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Yes, that's fine.
    The board URL in the ACP is primarily for links in emails, it has no bearing on the general functionality of the forum.
     
    ForestForTrees likes this.

Share This Page