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

I can't really help with so little information or context.

The Board URL in the option settings has zero effect on being able to log in to the ACP.
 

Error​

SQL query:

-- --------------------------------------------------------

--
-- Table structure for table xf_session_install
--

CREATE TABLE xf_session_install (
session_id varbinary(32) NOT NULL,
session_data mediumblob NOT NULL,
expiry_date int(10) UNSIGNED NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4


MySQL said: Documentation
#1050 - Table 'xf_session_install' already exists

How can i fix the above?
 
I know this is going to be a real noobie question but I've followed the instructions and all I get are blank pages coming back, clearly a file is missing.

If I search for the url https://domainname.com/devtest/admin.php I get a blank screen not the ACP login in screen.

If I go through all the files in the devtest folder I get a blank screen except for asking for the .htaccess file which presents me with

Forbidden​

You don't have permission to access /devtest/.htaccess on this server.

Can anyone point me in the right direction please?
 
A blank screen could be a suppressed error.

Add this to the src/config.php file:

PHP:
ini_set('display_errors', true);

Other than that, it's difficult to say without access to the installation.
 
A blank screen could be a suppressed error.

Add this to the src/config.php file:

PHP:
ini_set('display_errors', true);

Other than that, it's difficult to say without access to the installation.
Thanks Brogan.

I added that line to the src/config.php file and then asked for the url ...../devtest/admin.php and at least it threw back something;

Fatal error: Uncaught XF\Db\Exception: Access denied for user 'ElSanto'@'%' to database 'Area51' in /home/perf/hp3-ph-1010337/770/3192770/user/htdocs/devtest/src/XF/Db/Mysqli/Adapter.php:165 Stack trace: #0 /home/perf/hp3-ph-1010337/770/3192770/user/htdocs/devtest/src/XF/Db/Mysqli/Adapter.php(28): XF\Db\Mysqli\Adapter->makeConnection(Array) #1 /home/perf/hp3-ph-1010337/770/3192770/user/htdocs/devtest/src/XF/Db/AbstractAdapter.php(60): XF\Db\Mysqli\Adapter->getConnection() #2 /home/perf/hp3-ph-1010337/770/3192770/user/htdocs/devtest/src/XF/Db/Mysqli/Adapter.php(113): XF\Db\AbstractAdapter->connect() #3 /home/perf/hp3-ph-1010337/770/3192770/user/htdocs/devtest/src/XF/Db/AbstractAdapter.php(516): XF\Db\Mysqli\Adapter->escapeString('options') #4 /home/perf/hp3-ph-1010337/770/3192770/user/htdocs/devtest/src/XF/Db/AbstractAdapter.php(494): XF\Db\AbstractAdapter->quote('options') #5 /home/perf/hp3-ph-1010337/770/3192770/user/htdocs/devtest/src/XF/DataRegistry.php(138): XF\Db\AbstractAdapter->quote(Array) #6 /home/perf/hp3-ph-101 in /home/perf/hp3-ph-1010337/770/3192770/user/htdocs/devtest/src/XF/Db/Mysqli/Adapter.php on line 165
 
The credentials in the config file don't match the DB user/password.
Hmmm, I've double and triple checked the details in the config.php file and they are definitely correct, if I apply the same details to MySQLWorkbench I can access the database no probs, same via my Host's control panel.

For what it's worth I've a config.php file and a config.php.default file, the latter being devoid of any of the DB details, just contains the code placeholders for them, ie.

  1. <?php
  2. $config['db']['host'] = 'localhost';
  3. $config['db']['port'] = 3306;
  4. $config['db']['username'] = '';
  5. $config['db']['password'] = '';
  6. $config['db']['dbname'] = '';
  7. $config['db']['socket'] = null;

  8. $config['fullUnicode'] = true;
 
Click on the MySQL Databases icon and create a new database and user.

Click on the phpMyAdmin icon and export and import the database or copy the existing database using the Operations tab.
 
@Brogan thanks,

I followed the steps, but when I edited the test forum, I immediately saw that my edits affect my live site! o_O

I suspect it has something to do with my htaccess file, which I copied from my livesite, please could you advise what I should edit there? do I need to change the sitename.com/livesite to sitename.com/test in the test site's htaccess file?

In addition, I tried to password protect the test folder with cpanel, but it seems that this setting was overwritten by the htaccess?

# 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>
</IfModule>
# LS Cache
<IfModule LiteSpeed>
#CacheLookup public on
### LSCACHE START LOGIN COOKIE ###
RewriteRule .* - [E="cache-vary:xf_style_id,xf_language_id"]
### LSCACHE END LOGIN COOKIE ###
</IfModule>

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 405 default
ErrorDocument 406 default
ErrorDocument 500 default
ErrorDocument 501 default
ErrorDocument 503 default

<IfModule mod_rewrite.c>
RewriteEngine On

# 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 /livesite
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.sitename.com/livesite/$1 [R=301,L]

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

RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

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]
 
Top Bottom