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

Did you change the config.php file in the cloned path with your new database credentials?
Of course
This is nuts, unless perhaps you have left "Enable board URL canonicalization" turned on?
Enable board URL canonicalization was enabled by default.
It's not a case of two databases being synced, it's a case of one database viewed by two different URLS. As above the config.php must be changed to reference the test database, not the live database.
Both configuration files contain distinct database information, indicating that the live site operates with a different database setup. I have copied the database tables from the live site to the newly created test database and updated the configuration file to reflect the relevant details.
 
OK, that's potentially your problem.
Unfortunately, If I change it from the subdomain or newly cloned site original/live site is changing it too.


Let me explain What I did from the beginning.

1. Copied all files from the live site to the subdomain.
2. Created a database for a subdomain and copied all the database tables from the live site to the newly created database.
3. Edit config.php on a subdomain change the information with the newly created database and added this code on config.php

Code:
$config['enableMail'] = false;

$config['cookie'] = array(
'prefix' => 'testsf_',
'path' => '/',
'domain' => 'beta.subdomain.com'
);

Did I do all the steps correctly?
 
Last edited:
Did I do all the steps correctly?
Well, they certainly sound OK.

The canonicalisation thing will bite you though, if you didn't (a) change the board URL or (b) turn off canonicalisation entirely. The symptom will be somewhat obvious but only if you look for it, which is easier said than done because you kind-of assume that if you load test.domain.com instead of www.domain.com, then you will still be on test.domain.com when the page loads. Instead, the canonicalisation will send you to www.domain.com, automagically.
Quoting from the ACP text on this:
If enabled, the board URL setting will be treated as the canonical installation URL. If visitors access your site through a different URL, they will be redirected to the appropriate canonical URL. When enabled, you must ensure that your board URL setting is correct. If it is not correct, areas outside the admin control panel will not be accessible!

So, you can simply check your address bar to see if it stays on the test site where you sent it.
If it does, then canonicalisation isn't your problem.
 
@Neilski Do I need to disable it on both sites? Live and Cloned one?
Thanks.
Only the cloned site.
But you don't even need to do that much - once you suspect that this is the issue, just carefully check the URL in the address bar after sending your browser to the cloned site. If it automagically redirects to the live site, then bingo, that's why you've been having the issues you've had...
 
Back
Top Bottom