Creating development Ultimate site

Anyone know how to create a cloned site for Ultimate? For PRO, I used to:

  1. copy the document root to a new directory
  2. create a subdomain using the new directory as the document root
  3. copy the database to databasename_dev (add user, set perms, etc.)
  4. Adjust config.local.php for new dbname and new domain name (I.e. dev.site.com)
  5. remove the var/cache directory
  6. login via dev.site.com/admin.php and add ?cc again (to pick up the other cached data)



    But with ultimate, there is no ?cc to clear the cache. Yes, removing the var/cache directory does cause it to be rebuilt (I think).



    But when I try to login via admin panel of dev.site.com/admin.php I just get taken back to the login screen. I.e. like it can't create the session and using just dev.stie.com generates an smarty error that it can't find exception.tpl (I.e. not finding the proper store for the main site)…



    Has anyone created a development copy of a store and gotten it to work? If so, could really use this “list” so I don't have to spend hours figuring it out.



    Unfortunately, this site has many problems since it was converted by someone else. So trying to create a clone to debug/fix it but I might be fighting a losing battle. Would appreciate any learning anyone has related to the specfics of Ultimate.



    And how do you clear the cache in Ultimate?

I am not sure what problems you are having. &cc works fine in Ultimate. The only difference is you need to choose a store first. Then you can clear the cache using &cc for that store. &cc doesn't do any good if you are on the All Stores setting.



Ultimate uses something like



/httpdocs/var/cache/templates/stores/1

/httpdocs/var/cache/templates/stores/2

etc.





In Ultimate paying attention to what store you are using is important. Also, some admin settings are only viewable and editable when using the All Stores setting.

Hi there,



I don't have a list, but I am sure I can help you out. I have a development, staging and live version of an ultimate store.



?cc works for me on an ultimate store when I have been modifying templates, you shouldn't have a problem there.



I am also in a login loop on admin for my staging site… I am assuming that you have your domain names setup like:



www.livestore.com

dev.livestore.com



I found yesterday that I had a login loop on dev.livestore.com, and couldn't get in. But I could get into the admin for www.livestore.com. I found that when I was in the admin for www.livestore.com, I could get into the admin for dev.livestore.com



Maybe its a cookie issue or something like that in regards to subdomains…? Don't know.



I don't see a problem with the steps you have, the only one thing I would check is that you copied the directories with the correct permissions. Not sure what platform you are on, but you need to tell cp that you want to mirror the permissions. That might be your problem.

I couldn't find where it looked for GET['cc'] or REQUEST['cc'] in any of the php files in the root of the store nor in the core directory.

If it's buried off in the templates now somewhere, that's a possibility.



I'm sure the admin issue is a session issue (cookie). I've seen this in PRO and when cs-cart helpdesk is asked about it they just give the standard “can't reproduce in the demo store” and tell me that when it can't create the session (or retrieve it from the session cookie) that's what happens. I tried it in two browsers and neither would work (FF and Chrome).



On the customer side I guess I'll have to instrument it to find out which store it is trying to access. There are both stores/1 and stores/2 and there are exception.tpl files in both stores/1/skins/customer and stores/2/skins/customers



I do notice there is now a stores/1/var/cache directory (and 2 also) so maybe it's a cache issue related to the customer side. Clearing it now but doing so via FTP takes forever. Will update if it has any effect.



Yes, I've cleared the browser caches as well for the admin issue(s).

Cool, well you helped me anyway… thought I had cleared the cookies, but it turns out I hadn't. At least I can get back into staging now.



Did you check the permissions? If you only have ftp access, i assume you downloaded the first store and uploaded again? Might be worth checking the permissions on the important folders.



Oh, the other thing to keep in mind when you duplicate a stores database is once you get access to the admin side. Go into the stores and make sure the storefront url is set correctly there, otherwise you will get a 404 error when you try and browse the site. I haven't seen anyone else mention doing this when it comes to duplicating a cs-cart installation. This setting isn't linked to config.local.php … of course you could do this directly in the database (not sure what table it is in).

I used cpanel and tar archives to copy the site. All (both) under the same account.

Was able to get into admin after going a bit further back in clearing the cookies in one browser.

However, the customer side is still a nogo.



I see what you mean about setting the company URL. However, when I changed it and cleared the cache, the admin graphic still shows it going to the original domain name versus the new subdomain I just set it to. I checked the settings DB table and it has the proper value. Also tried logging out and back in, same result.



Turns out it is in cscart_companies and there are 3 fields to adjust (url storefront and secure_storefront). Did that and it seems to be working.



My hat off to you @natewallis

I've been doing this all along with Ultimate, I use the same steps as you with a few further changes required:


  1. copy the document root to a new directory
  2. create a subdomain using the new directory as the document root
  3. copy the database to databasename_dev (add user, set perms, etc.)
  4. Adjust config.local.php for new dbname and new domain name (I.e. dev.site.com)
  5. remove the var/cache directory
  6. run database query to replace instances of 'www.site.com' with 'dev.site.com'
  7. login via dev.site.com/admin.php and add ?cc again as each individual store user (to pick up the other cached data per store)



    I originally had the same problem, with the admin log-in loop, but found the issue to be caused by the storefront URL's being stored for the primary domain in config.local.php AND cscart_companies.

I've seen the login loop issue in PRO when using subdomains. According to the helpdesk this is because it can't create a session. Clearing cookies for anything related to 'site.com' will provide temporary relief, but once both domains are accessed via admin, one tends to go away upon next login. Most notably in FF. I think it is because the use the base domain as the cookie name versus the FQDN. But not sure on that one. Debugging the Session class is a real pain since it's like Quantum Mechanics… When you look at it, it changes into something else!



Only issue in the list is that you need to be careful on your query is were were not using a 'www' hostname/sub-domain in the parent environment because 'site.com' will be in email addresses and all kinds of other things. I think the only table that must be changed for development is cscart_companies. Too bad this can't adjust in the admin environment so NO ONE has to edit the db directly.

We're running v.3.0.6 on http://nazelie.com - so we wanted to clone the site for a development environment at http://2013.nazelie.com… We followed the instructions below exactly (note that we don't have a separate SSL certificate for 2013.nazelie.com), including removing all cookies, clearing cache etc.



The consumer-facing portion works fine at http://2013.nazelie.com, but when you try to access the admin panel at

https://2013.nazelie.com/admincp.php, the browser redirects to https://nazelie.com/admincp.php



How can I resolve this?






[quote name='StellarBytes' timestamp='1359651541' post='154131']

I've been doing this all along with Ultimate, I use the same steps as you with a few further changes required:


  1. copy the document root to a new directory
  2. create a subdomain using the new directory as the document root
  3. copy the database to databasename_dev (add user, set perms, etc.)
  4. Adjust config.local.php for new dbname and new domain name (I.e. dev.site.com)
  5. remove the var/cache directory
  6. run database query to replace instances of 'www.site.com' with 'dev.site.com'
  7. login via dev.site.com/admin.php and add ?cc again as each individual store user (to pick up the other cached data per store)



    I originally had the same problem, with the admin log-in loop, but found the issue to be caused by the storefront URL's being stored for the primary domain in config.local.php AND cscart_companies.

    [/quote]

If you've updated your config.local.php properly, then you need to verify your redirects (cPanel as well as .htaccess).

[quote name='tbirnseth' timestamp='1371243109' post='163616']

If you've updated your config.local.php properly, then you need to verify your redirects (cPanel as well as .htaccess).

[/quote]



what am I looking for in cpanel?

.htaccess looks ok:



DirectoryIndex index.html index.php





RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !.(png|gif|ico|swf|jpe?g|js|css)$

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php?sef_rewrite=1 [L,QSA]



Check the table cscart_companies and fix the URL's in the rows in there. There is no admin interface for adjusting those URL's.

Used to be that you could simply copy a DB and reference it. Not anymore.

[quote name='tbirnseth' timestamp='1371256716' post='163623']

Check the table cscart_companies and fix the URL's in the rows in there. There is no admin interface for adjusting those URL's.

Used to be that you could simply copy a DB and reference it. Not anymore.

[/quote]



In version 3.0.6, the table is called csc_companies. I updated it (example.com), but the problem persists… every time I try to access http://nazelie.net/admincp.php, I get redirected to https://nazelie.com/admincp.php?dispatch=auth.login_form&return_url=admincp.php



Weird thing, there's NOTHING in the mysql database with nazelie.com…(did a global search & replace) so how the F%&C would it reroute to the nazelie.com domain???