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

dextr

Member
# Mod_security can interfere with uploading of content such as attachments. If you
# cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
# SecFilterEngine Off
# SecFilterScanPOST Off
#</IfModule>

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default

<IfModule mod_rewrite.c>


RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.<livesite>\.com$
RewriteRule ^(.*)$ http://www.<livesite>.com/community/$1 [R=301,L]

# If you are having problems with the rewrite rules, remove the "#" from the
# line that begins "RewriteBase" below. You will also have to change the path
# of the rewrite to reflect the path to your XenForo installation.
RewriteBase /community

# This line may be needed to enable WebDAV editing with PHP as a CGI.
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</IfModule>




_____________________________________________________________________




The above is the localhost/communty/.htaccess file.
 

Brogan

XenForo moderator
Staff member
You have a redirect:
Code:
RewriteCond %{HTTP_HOST} !^www\.<livesite>\.com$
RewriteRule ^(.*)$ http://www.<livesite>.com/community/$1 [R=301,L]

You only need a basic .htaccess on localhost.
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]
 

dextr

Member
Awesome ..

Thanks Brogan.

I just commented out the two lines of the redirect and its working perfectly.

I was also having the same issue that @LukerLou was having. I edited the /library/config.php and changed the db username & password to the localhost 'root' user, it fixed that.

Local copy setup and working just great. Thanks again.
 

silverSl!DE

Member
Hey,
I'm trying to dublicate a livesite to a local testsite on my local machine, to test the 1.2 => 1.3 upgrade with all the addons and stuff.
imported the database (direct import via local shell)
rsynced everything to my local system.
added cache config and changed db-acc in config.php
whole dir is owned by www-data

everything seems to work as expected. as long as I'm not logged in on the testsite, I can do pretty much every thing, what a guest on a lifesite is able to.
BUT when I try to log in: XF gives me this:
"A server error occurred. Please try again later."
even with the same user and pw as the livesite, I'm not able to log in

any hints, what I'm doing wrong?
 

silverSl!DE

Member
thx for the fast response,
but I don't have anything in apache2 error log nor in the mysql error log
running on debian jessie amd64

this is all i get when I try to log in:
error1.png
 

silverSl!DE

Member
sorted it out, by checking the "xf_error_log" table:
Code:
.../library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('DELETE FROM `xf...')
.../library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), 'DELETE FROM `xf...')
.../library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('DELETE FROM `xf...')
.../library/Zend/Db/Adapter/Abstract.php(661): Zend_Db_Adapter_Abstract->query('DELETE FROM `xf...')

I simply forgot the DATA DELETE permission on that DB for my DB-user.:oops:

Now I'm running into other issues, but I think, I'll get it on my own from now. THX (y)
 

dextr

Member
I've managed to install a local copy on XAMPP, everything is running fine. (XF 1.1)

>>But whenever I open a thread (on XAMPP) I get this error at the top of the page ..
QEzD75o.png

This error only comes when opening a thread, navigating everywhere else in the forum is just fine. Posting in threads, editing, deleting all works as expected.



>>This is what I get on the live site, where its working fine.
LLvA4GK.png




>>Installed Styles.

FjmWqHv.png
 

dextr

Member
Hello again,

Finally purchased the 1.3 License and ready to upgrade. Currently on XF 1.1.3


I made a live site backup on the server itself.

www.<live-site>.com/community [Actual Forum]
www.<live-site>.com/community2 [Backup Forum]

Now community2 loads just fine, as per the guide I made changes config.php as below.

<?php
$config['db']['host'] = 'localhost';
$config['db']['port'] = '3306';
$config['db']['username'] = 'XYZ123';
$config['db']['password'] = 'ABC123';
$config['db']['dbname'] = 'DEF123';
$config['superAdmins'] = '76';
$config['debug'] = 1;
$config['cache']['enabled'] = true;
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions'] = array(
'caching' => true,
'automatic_serialization' => true,
'lifetime' => 1800,
'cache_id_prefix' => 'xf2_'
);

$config['enableMail'] = false;

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

.htaccess file has also been updated to

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]


_________________________________________________________________________________

Now whenever I try to login with an existing account or click on any of the section links (or any link) I am redirected to the 404 page of my website .. What could be wrong ?
 

dextr

Member
The default 404 page of my website which I have setup ..

I am being shown the 404 page while in the Dev dir (and URL)

I am able to login into the admin control panel just fine. But after that I still get the error if I use any links on the actual forum.
 
Last edited:

woei

Well-known member
The default 404 page of my website which I have setup ..

I am being shown the 404 page while in the Dev dir (and URL)

I am able to login into the admin control panel just fine. But after that I still get the error if I use any links on the actual forum.

Did you change your xenforo site url settings?

Home --> Options --> Basic Board Information

Change the board url to the url with your directory.
 
Top