How to duplicate a live site to use as a test site

My test site has been copied but a few things seems to be missing:

The forum is missing the input field so I cannot reply to or start any new threads.

Also the Article on the Home page are supposed to be displayed in order of last activity but that content will not display. Articles are there when looking at the categories.

Server errors indicate that it is looking for files with sequence#s north of the existing files. (ie. ...article_images/l/3/3529.jpg but files only go to 3528.jpg

Not sure how to fix that.
 
Last edited:
Hi. I have done what you said in the guide and all has gone to plan I think. Apart from I am getting this.

"You don't have permission to access /srotestsite/ on this server."

Any ideas to how I fix this please.

Ps awesome guide needed to do a test site so bad and this has given us all just that :)
 
That is a server level permission issue.

Try loading the full URL including the index.php.
If that still doesn't work, you may need to adjust the perms.

It could also be something like mod_security.

Your sysadmin or host should be able to resolve it.
 
That is a server level permission issue.

Try loading the full URL including the index.php.
If that still doesn't work, you may need to adjust the perms.

It could also be something like mod_security.

Your sysadmin or host should be able to resolve it.

The indix thing worked but Not much going and I have worked out why.

There is no database there. I have it made and have imported my main site database to but its showing up empty. Done it 6 times now and still showing its empty.

I will have to try and fix it.
 
@Brogan Maybe its a good idea to add instructions to:
  • disable sitemap rebuild
  • disable sitemap submit
  • disable crons
  • disable feed
  • use ssh to copy DB on server
  • use ssh to copy files on server
 
Last edited:
I have 2 questions.

1st it says to create a database with a different name.
How do I create a database? With Cpanel? MySQL? Where is this database being created? Doesn't the Database have to have a structure when you create it?

2nd when it's all done, how do I access the actual website? Do I have to go and register a new URL to then access it?

I have my site hosted on A2 Hosting, and I am using CPanel if that helps or makes a difference.

Thanks!
 
These instructions explain how to create a test installation which is an exact duplicate of your live installation.

On Your Server
  • Create a new test database with a different database name, user name and password to your live installation
  • Export your current live database and import it into your new test database
  • Create a new directory on your server, e.g. /test
  • Copy all of the files from your current live site directory to the new /test directory
  • Edit the /library/config.php file in your new /test directory and change the database details to match your new test database
  • Update Options -> Basic Board Information -> Board Title to something like Test MySite
  • Update Options -> Basic Board Information -> Board URL to match the new test URL
  • If you are using a cache on your live site, update the new /test directory /library/config.php file with a different cache prefix
  • Add the code below to the bottom of your new /test directory /library/config.php file
PHP:
$config['enableMail'] = false;

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

Don't forget that the test installation should be password protected to stop others from accessing it.

You can do that with .htaccess - copy the instructions here but apply it to the directory where the test install is located instead: http://xenforo.com/community/resour...and-the-install-directory-using-htaccess.353/


On Your Computer (Localhost)

If you wish to duplicate your live installation on your PC, first you need to install a program such as XAMPP: http://xenforo.com/community/resources/how-to-install-xenforo-locally-to-your-pc-using-xampp.355/

Then the steps are very similar:
  • Create a test database with the same database name, user name and password as your live installation*
  • Export your current live database and import it into your new test database
  • Create a new directory on your computer to match your live site directory, if it is not installed in the root
  • Copy all of the files from your current live site directory to the same directory
  • Replace the .htaccess file with the following contents
    • Code:
      RewriteEngine On
      
      RewriteCond %{REQUEST_FILENAME} -f [OR]
      RewriteCond %{REQUEST_FILENAME} -l [OR]
      RewriteCond %{REQUEST_FILENAME} -d
      RewriteRule ^.*$ - [NC,L]
      RewriteRule ^(data|js|styles|install) - [NC,L]
      RewriteRule ^.*$ index.php [NC,L]
  • Add the code below to the bottom of the new test installation /library/config.php file
    • PHP:
      $config['enableMail'] = false;
      
      $config['cookie'] = array(
      'prefix' => 'test_',
      'path' => '/',
      'domain' => ''
      );

*If you use root/root for the user name and password for XAMPP, then ensure you update the /library/config.php file accordingly.

Is this still compatible with the lates version (2.1) ?
 
I'm not sure if the best way to duplicate the files is download to my desktop then upload or to open the two remote windows on my FTP client (Transmit on Mac) and drag and drop from one to the other.

Are there any pros /cons of doing this either way?

I notice that sometimes some files seem to stall for ever or transfer incerdibly slowly, This seems to happen especially with files in internal_data/code_cache for example. Or else I get a message "cannot be found" while downloading. Is this a significant issue or can I just ignore those messages?

NB: I am using using passive mode and Auto (as opposed to ASCII or Binary) Is that OK?
 
Just realised I could instead download the directories (compressed) using jetbackup on cpanel. That should d avoid the slowing down of FTP. Any reason why I shouldn't just do that?.

Or, maybe even better, use filemanager in cpanel to copy the files/folders into the development forum folder
 
Last edited:
Just realised I could instead download the directories (compressed) using jetbackup on cpanel. That should d avoid the slowing down of FTP. Any reason why I shouldn't just do that?.

Or, maybe even better, use filemanager in cpanel to copy the files/folders into the development forum folder

SSH + cp -r ;-)
 
Could use some help. I have created a copy locally no problem.

I created an online test at pug.trumbower.com, no rewrite on and only the main page shows up. Can't seem to see the forum or any other pages. Need a few pointers to what else to look at.

Thanks
 
Hi All,

I'm taking over an XF v1.5.11 installation and have a few questions about testing and upgrading -- first to 1.5.21 and then to the lastest 2.x. I've been able to replicate the system locally using Docker. Everything runs fine. My question is -- what's the best way to push upgrades / new add-ons / my changes from the test / dev environment to production? I'm assuming I can't just run the upgrades locally and deploy them, because there may be changes to the database. So, upgrading versions and installing add-ons will need to happen on the production box. Is this correct? If so, the flow would be test everything locally and then repeat everything in production, hopefully with any kinks worked out.

I'm interested to hear how other people handle this and keep their test / dev environment in sync with production.
 
. So, upgrading versions and installing add-ons will need to happen on the production box. Is this correct? If so, the flow would be test everything locally and then repeat everything in production, hopefully with any kinks worked out.

But the one big useful thing is regarding the style. You can create edits to your style on a test environment, export and then import the style into your live forum.
 
But the one big useful thing is regarding the style. You can create edits to your style on a test environment, export and then import the style into your live forum.

Thanks for the quick reply!

Yes, I saw the export ability in the admin control panel. That's definitely a plus. I'm still working my way through the manuals, but setting everything up locally was pretty easy. So, that was encouraging.

Is there a guide or detailed explanation of how to setup multiple servers in an HA environment? I'm mostly interested in what information needs to be shared between servers. I would like to mount the shared stuff on EFS (AWS) / NFS. I'm not sure if I need to mount the entire contents of the data and internal_data directories, or some subset of them. Any insight would be appreciated!
 
Top Bottom