Creating A Development Site

To create a development site for V4, do the following (I assume you have SSH and cpanel access): For notation purposes, I'll use CP for your cpanel user name.



Please note that this is a rough sketch and should be considered an outline for creating a dev site. You mileage may vary depending on your site configuration, cpanel setup, etc. But this utilizes the most common cpanel environments we've seen. Also note that this is basically off the top of my head. I have scripts I use for consistent results for clients that ask us to do this for them. If I've forgotten anything, we can ammend the post till it meets people's needs.



In Cpanel[list=1]

[]Create a new subdomain of 'dev' in your site via cpanel Subdomains under the Domain section

[list=1]

[
]Change the document root (directory) from public_html/dev to just dev (this says to have the document root as /home/CP/dev instead of /home/CP/public_html/dev). We do NOT recommend having a development site in the subdirectory of your production store.

[]click Save

[/list] [
]Click mySQL Databases

[list=1]

[]If your old DB was named cart, create a new one of the name cart_dev

[
]Assign the same database user to that database as is used for your main site.

[list=1]

[]Set the permissions to All

[/list]

[/list] [
]Go to the security section and enter directory permission security for /home/CP/dev so that robots and casual users won't be able to access your dev site.

[]Open phpMyAdmin

[list=1]

[
]Select the original database 'cart'

[]Select the Operations tab

[list=1]

[
]copy the original database to the new one (cart_dev) deselecting the 'create database' checkbox.

[/list]

[/list]

[/list]

Server[list=1]

[]Login to your server using your CP (you should now probably be in the directory /home CP)

[list=1]

[
]Execute the following commands.

[list=1]

[]$ rm -rf public_html/var/cache

[
]$ (cd public_html; tar -c .) | (cd dev; tar -x)

[]vim config.local.php

[list=1]

[
]change db_name to new db name (I.e. CP_cart_dev)

[]change http_host to dev.yoursite.com

[
]change https_host to dev.yoursite.com

[]Make sure directory/file permissions are 755/644

[
]save and exit

[/list] []Review .htaccess for any rewrite rules you may have added and have them now point to dev.yoursite.com If you've not modified the distributed .htaccess file you can skip this step.

[/list]

[/list]

[/list]

Cs-cart:[list=1]

[
]Open a fresh browser (not sometimes cs-cart has login issues with sub-domains, hence the fresh browser)

[list=1]

[]Login to your new admin panel (I.e. dev.yoursite.com/[your_old_admin.php])

[
]Click the 'Manage stores' option from the top left store selector.

[list=1]

[]For each store, prepend 'dev.' to the storefront urls.

[
]click save and exit

[/list] []Click the open-storefront icon and verify that you get to dev.yoursite.com and then click some categories or other links to ensure you get to 'dev' site.

[/list] [
]Contact helpdesk and tell them the domain name and that it is a development site and is NOT publicly accessible.

[/list]

Have fun…

OK so I have done all of this, but on accessing the new admin it just redirects to the old admin?



I have double checked the .htaccess and config_local.php, is there not anything else to check?

Finally go access to it, I had to alter the storefront URL in cscart_companies and disable SSL via the original admin (as was forcing SSL and redirecting) and then re-copy across the database and then delete cache. Ball ache! Thanks for the above though…

SSL can be a problem but this is very hosting/certificate dependent. The storefronts should have nothing to do with admin access. But I'm guessing when you changed the storefront URL, the cache was automatically cleared.



I usually disable SSL on the dev site.

Hey guys!

When you say: "cscart_companies" what do you mean?

Is that a file?

Or a table in the database?

I can't seem to find that information...

Thanks!

David

cscart_companies is a database table that contains information for different storefronts of the site (Cs-cart edition) and Vendor information (MVE edition).