solved How to move a production site to a staging server

derrickhand300
@derrickhand300
6 years ago
1,353 posts
Hello-I would like to move a copy of my production site to a new url as a staging site. I have about 10 hours tied up in failed attempts
Some of the Docs I have read get "close"
https://www.jamroom.net/the-jamroom-network/documentation/howto/1991/howto-move-jr5-to-a-different-server
https://www.jamroom.net/the-jamroom-network/documentation/howto/4153/howto-clone-one-server-to-another-server

But none cover the issue of using a new LIVE URL for the staging server
Are there Docs that cover this and if not could you explain the process and when you get to the part about moving the database please explain like you are talking to a 10 yr old :)
Thank you Michael

updated by @derrickhand300: 05/16/18 11:42:25PM
michael
@michael
6 years ago
7,714 posts
you might be over thinking it.

* copy the files to the new server.
* copy the database to the new server.
* update the /data/config/conf.php with the site domain name and the database password.

finished, so login and run the integrity check.
derrickhand300
@derrickhand300
6 years ago
1,353 posts
Thanks-but what about the database having a different name?
Also the htaccess file still has the url's from the previous url...
updated by @derrickhand300: 02/12/18 07:21:18PM
michael
@michael
6 years ago
7,714 posts
doesnt matter, you set the database credentials in the config.php file. If its a different name, just change it to the correct one in that file.
michael
@michael
6 years ago
7,714 posts
For the .htaccess file, use a default one from a fresh jamroom install. that has no domian names in it.

you can find a copy of it at:
/modules/jrCore/root/.htaccess

copy it to your root folder.
derrickhand300
@derrickhand300
6 years ago
1,353 posts
Thanks i will try again- thats pretty much what i did twice today- each time i ended up with a site that was just a 500 error
michael
@michael
6 years ago
7,714 posts
nothing wrong with that. you then need to figure out what the server is complaining about and fix that.

A 500 error is the server saying: "Your site told me to do THIS, but the server config files say I should do THAT. So im just going to do nothing until you fix something."
derrickhand300
@derrickhand300
6 years ago
1,353 posts
Dumb question...
Can I just make a compressed copy in cpanel of the site - then unzip it on the new site and drag all the files to public_html folder?
8 GB takes a day here downloading it ftp with my connection then uploading it...
I notice JR Docs say to unzip a new install of jamroom on your pc then upload it via FTP....just wonder if i can install using this much faster route?
Both cpanel accounts are on the same server...
updated by @derrickhand300: 02/12/18 07:46:58PM
michael
@michael
6 years ago
7,714 posts
yes you can do that. Its a good idea.
derrickhand300
@derrickhand300
6 years ago
1,353 posts
michael:
For the .htaccess file, use a default one from a fresh jamroom install. that has no domian names in it.

you can find a copy of it at:
/modules/jrCore/root/.htaccess

copy it to your root folder.

Sorry...Im not finding a /root/ folder in jrCore
Capture.JPG
Capture.JPG  •  77KB

michael
@michael
6 years ago
7,714 posts
Then download the open source version:
https://www.jamroom.net/products

It will have an .htaccess file in it.
derrickhand300
@derrickhand300
6 years ago
1,353 posts
Thats the version I downloaded 1 hours ago...I will download it again...does the htaccess HAVE to be in jrCore/root..or can i use the one thats in public_html?
michael
@michael
6 years ago
7,714 posts
use the one that is in public_html.
derrickhand300
@derrickhand300
6 years ago
1,353 posts
Thanks-I have done all of the above here is what i have
https://www.americandriller.com/

If you add index.html to the url you can see part of a site
https://www.americandriller.com/index.html

I cant run an integrity check because I cant log in...but i have run repair.php bit changes nothing

also notice all the links on the staging site when you click them go to the production site
brian
@brian
6 years ago
10,148 posts
Making a "clone" of an existing site is just a few steps:

1) Download the entire public_html directory for the source site, and upload it to the clone site - now you have an exact copy of the files

2) Export the source site database using a DB manager such as phpmyadmin, sequel pro or the built in Adminer - then import this into a NEW database created for the clone site

3) modify the data/config/config.php file on the CLONE site to use the new database name (and user/password if different)

4) Log into the CLONE site and go to ACP -> Communication -> Email Support and set the "active email system" to "Log sent email to activity log" - this is so you don't send emails from your clone system to existing users of your live system.

Quote:
I cant run an integrity check because I cant log in...but i have run repair.php bit changes nothing

This means you are missing either keys files or the database.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
derrickhand300
@derrickhand300
6 years ago
1,353 posts
Thanks brian...here are the actions my server took
"Hello,

I found the following sql files in the backup:

-rw-r--r-- root/root 6013356 2018-02-13 00:11 mysql/rough_ocart33.sql
-rw-r--r-- root/root 1276720 2018-02-13 00:11 mysql/rough_directory.sql
-rw-r--r-- root/root 16152757 2018-02-13 00:11 mysql/rough_neckcity.sql

I am leaving these backups in place in a newly the newly created mysql/ directory under /home/americandriller/public_html.


I created the following database for the file /home/americandriller/public_html/config.php :

User: american_rough
Database: american_rough_neckcity
Password:

Now, you just need to edit the file with these credentials and the new domain.

I found the following configuration file as well:

/home/americandriller/public_html/directory/defaults.php

I created this database for this sql data:

User: american_curtis
Database: american_rough_directory
Password:


Regarding the last sql files, which seems to be used in the following configuration files, I created the database with the details below (so you will need to update the configuration files):

./store/admin/config.php
./store/shipstation/config.php
./store/config.php
./store_2_11.bak/admin/config.php
./store_2_11.bak/shipstation/config.php
./store_2_11.bak/config.php
./store.bak/admin/config.php
./store.bak/shipstation/config.php
./store.bak/config.php


User: american__ocart3
Database: american_ocart33
Password:


The data is the sql backup files has been imported into each newly created database. Now, all that you should have to do is to edit the configuration files with the new databases' information, and then replace the .htaccess file with a default, and any other instructions as advised by the CMS support team.


Thanks,

----------
Kayla A."

Then i changed the config.php and uploaded a new default copy of htaccess...still no go
updated by @derrickhand300: 02/13/18 09:17:48AM
derrickhand300
@derrickhand300
6 years ago
1,353 posts
(above passwords removed)
Those last 2 she speaks of are a store and a directory installed as sub folders...i have not messed with them yet- not until i get the JR part working
updated by @derrickhand300: 02/13/18 09:18:25AM
derrickhand300
@derrickhand300
6 years ago
1,353 posts
Here is what i have in the config.php file (password removed)
<?php
$_conf['jrCore_db_host'] = 'localhost';
$_conf['jrCore_db_port'] = '3306';
$_conf['jrCore_db_name'] = 'american_rough_neckcity';
$_conf['jrCore_db_user'] = 'american_rough';
$_conf['jrCore_db_pass'] = 'xxxxxxx';
$_conf['jrCore_base_url'] = 'https://www.americandriller.com';
$_conf['jrCore_ffmpeg_binary'] = '/usr/bin/ffmpeg';

And here is the default htaccess file I am using
# Jamroom Apache .htaccess file
DirectoryIndex modules/jrCore/router.php

Options +FollowSymLinks
Options -MultiViews -Indexes

# Use ETags
<IfModule mod_headers.c>
Header unset ETag
FileETag None
# Expires for CSS, JS and Images
<FilesMatch ".(ico|jpg|jpeg|png|gif|js|css|swf)$">
Header set Expires "Thu, 15 Apr 2020 20:00:00 GMT"
</FilesMatch>
<FilesMatch ".(eot|ttf|otf|woff)">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>

# Compress everything we can
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript text/javascript-x application/javascript
</IfModule>

# All requests through the router
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^modules/.*\.tpl$ - [F,L,NC]
RewriteRule ^skins/.*\.tpl$ - [F,L,NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ modules/jrCore/router.php?_uri=$1 [NC,L]
</IfModule>

updated by @derrickhand300: 02/13/18 09:22:49AM
derrickhand300
@derrickhand300
6 years ago
1,353 posts
the folder you stated data/config/config.php still contains the old database details!
I have been editing the config.php file in public_html
so there is a difference?
I will let you know...
brian
@brian
6 years ago
10,148 posts
The only config.php file that Jamroom uses is located at data/config/config.php ...


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
derrickhand300
@derrickhand300
6 years ago
1,353 posts
Dang...still not working,,,are there other congig.php files that need to be adjusted besides these two?
Also should i have left the config.php file in public_html alone? ( it als has the new database credentials)
brian
@brian
6 years ago
10,148 posts
No - delete the one in public_html - you should only have one config file:

public_html/data/config/config.php


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
derrickhand300
@derrickhand300
6 years ago
1,353 posts
Thanks brian...I have removed it and ran
https://www.americandriller.com/repair.php
still same issue... you are welcome to run the repair file
derrickhand300
@derrickhand300
6 years ago
1,353 posts
Ok so now i think the issue is my server set it up for the DB to go to the config file in public_html... I think it needs to go to data/config/config.php
brian
@brian
6 years ago
10,148 posts
So it's getting a 500 error - that means one of 2 things:

- either the Apache configuration for the domain is wrong (i.e. mod_rewrite is not allowed, mod_php is not configured, etc) OR
- there are PHP files missing from the install

Log in via FTP and go to the public_html/data/logs directory and download the "error_log" file - newest entries are at the bottom - that will tell us what the issue is.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
derrickhand300
@derrickhand300
6 years ago
1,353 posts
Thank you for that Brian and for helping me!
[13-Feb-2018 11:55:34 America/Tegucigalpa] PHP Fatal error:  require_once(): Failed opening required '/home/rough/public_html/store/system/startup.php' (include_path='.:/opt/cpanel/ea-php71/root/usr/share/pear') in /home/americandriller/public_html/modules/xxOpencart/include.php on line 118
I think this is the reason....I have not configured the DB details for the store in the /store folder yet...i will try that

I did not realize that something in a sub folder would give the main site a 500 error..

updated by @derrickhand300: 02/13/18 10:07:22AM
brian
@brian
6 years ago
10,148 posts
This is not a Jamroom file:

/home/rough/public_html/store/system/startup.php

It looks like you've done something custom to include a different script in your Jamroom init - it's looking for that file and not finding it.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
6 years ago
10,148 posts
and note that the directory is wrong:

/home/rough/public_html

versus:

/home/americandriller/public_html

You want to be careful here that you don't accidentally mess up your live site.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
derrickhand300
@derrickhand300
6 years ago
1,353 posts
THANKS...working on that also...
derrickhand300
@derrickhand300
6 years ago
1,353 posts
Thanks for everything Brian...i have the jamroom part of my site up-but my store which is installed in a sub folder in jamroom isnt showing up
I am getting this error in cpanel logs
[Tue Feb 13 16:49:34.959934 2018] [autoindex:error] [pid 21689] [client 216.198.163.158:33801] AH01276: Cannot serve directory /home/americandriller/public_html/store/admin/: No matching DirectoryIndex (modules/jrCore/router.php) found, and server-generated directory index forbidden by Options directive
Can you say what it means and how to fix it? Seems like it may be a configuration issue in Apache...I have a help ticket opened with my server...Just wondered your thoughts

updated by @derrickhand300: 02/13/18 03:21:09PM
derrickhand300
@derrickhand300
6 years ago
1,353 posts
Well i got my answer and wanted to post it
"Hello Curtis,
I have commented out the following directive in the .htaccess of the public_html directory:---
#DirectoryIndex modules/jrCore/router.php"

Want to Thank you Brian and Michael for all your help
brian
@brian
6 years ago
10,148 posts
That's wrong - do not uncomment that line or Jamroom won't work right. Instead, you need to create a .htaccess file in the /home/americandriller/public_html/store/admin directory that contains the correct INDEX file that is run when accessing that directory - i.e. index.php, index.html, etc.:

DirectoryIndex index.php index.htm index.html

Your server person should be able to help you with that.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
derrickhand300
@derrickhand300
6 years ago
1,353 posts
Yep...i just noticed i still could not access the admin area of the store even though the store now displays...so i checked cpanel again and found this error
[Tue Feb 13 17:39:59.865979 2018] [autoindex:error] [pid 26536] [client 216.198.163.158:35249] AH01276: Cannot serve directory /home/americandriller/public_html/: No matching DirectoryIndex (index.php,index.php5,index.php4,index.php3,index.perl,index.pl,index.plx,index.ppl,index.cgi,index.jsp,index.jp,index.phtml,index.shtml,index.xhtml,index.html,index.htm,index.wml,Default.html,Default.htm,default.html,default.htm,home.html,home.htm,index.js) found, and server-generated directory index forbidden by Options directive

I have forwarded your response to the server support
Thanks again

Tags