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

Can you install fresh XF files on localhost, but give it your live database? I know there'd be missing graphics and such. But should XF be able to somewhat load a working instance if you do that?
 
Hello

I've followed everything in this topic to test an update on a test subdomain before upgrading my real site (new folder subdomain, new database, new database user) change basic options in my new test site but i still have my basic options changed as same in my production website. How is it possible ?

And when i've finished the successfully the upgrade in my test site in the subdomain and when i go back to my production site that i really didn't touch during all the process i have a message that says "This site is under maintenance please come back later" and obviously the name of the site has changed.

How can the upgrade on my test site can change the options as same in my production site ?
Is it linked with something in the config.php file ?

Thanks
 
Last edited:
How does this method compare with making a snapshot of live production and have the snapshot restored to another VPS bearing a different domain name and making this domain hidden behind the firewall?
 
Very useful guide!

One gotcha that I just tripped over: needed to disable the "Automated bounced email handler". (This seems to run even when email is disabled in config.php.)
 
One gotcha that I just tripped over: needed to disable the "Automated bounced email handler". (This seems to run even when email is disabled in config.php.)
Should log that as a bug!
 
Very useful guide!

One gotcha that I just tripped over: needed to disable the "Automated bounced email handler". (This seems to run even when email is disabled in config.php.)
@Paul B - I'm building another test site and wondering if there's a way to edit the config.php to prevent the bounce handler from running? (E.g. in case it runs while you're loading the ACP to disable it...) For the time being, I'm just going to edit the DB...
 
You should disable all emails for test/dev installs.
Ah, that's not what I mean. I already disabled outgoing emails, but (caveat: memory fuzzy, some weeks elapsed now) on one of my test sites, I got an error that suggested the bounce handler had tried to fetch emails from the bounce address. This would interfere with the bounced email system by depriving the real site of any chance to see those bounces.
Unless of course you know that the bounce handler does NOT run when outgoing email is disabled? (Then of course I don't understand why I got the error I got - would have to go back and review my notes and logs carefully.)
 
Ah, that's not what I mean. I already disabled outgoing emails, but (caveat: memory fuzzy, some weeks elapsed now) on one of my test sites, I got an error that suggested the bounce handler had tried to fetch emails from the bounce address. This would interfere with the bounced email system by depriving the real site of any chance to see those bounces.
Unless of course you know that the bounce handler does NOT run when outgoing email is disabled? (Then of course I don't understand why I got the error I got - would have to go back and review my notes and logs carefully.)
When I copy my live site to a test site I only disable email and the bounce handler does not function. I do not bother turning it off. My last copy was on Sunday and that is when the email log stopped (after changing the config.php.)
 
When I copy my live site to a test site I only disable email and the bounce handler does not function. I do not bother turning it off. My last copy was on Sunday and that is when the email log stopped (after changing the config.php.)
A test site has less traffic, thus less likelihood of triggering the cron jobs, thus it's not often going to beat the live site to the bounces. However it could still happen, unless the code actually prevents it; my hasty skim of the code suggests that the bounce handler doesn't check if email is disabled, but I may have just missed it.
An absence of bounces in the test site log doesn't prove much by itself, is basically what I'm getting at.
 
Putting cookies into an array (instead of single line entries), as per Resource Overview/Updates, stopped my site from working. Is this still supposed to be valid for 2.2 / 2.3 ?

Code:
$config['cookie'] = array(
'prefix' => 'test_',
'path' => '/',
'domain' => ''
);
 
Well, I just re-read the code for the things that happen when $config['enableMail'] = false and I'm unable to see anything that would stop the bounce handler cron job from doing its thing. (I also rechecked XF/EmailBounce/Processor.php and see nothing there either.)
Got me thinking, the server cron is set to a live site (live site cmd.php path) not the test site so it's only firing once, not two times. The test site fails so it really never runs the bounce check and nothing goes on the server log??? So by setting the cron to server based it effectively kills the process. @Neilski
 
Last edited:
Top Bottom