What is the best practice setup for development & production?

Before I start my development and production going, just wanted to ask this question on the forum in regards to the best practice setup.



What is the best practice or cs-cart recommened setup for development and production servers?


  1. Should development be done on local setup or doesn’t matter?
  2. How is license shared or works if you have 2 or 3 environments?
  3. What is the best practise approach to production?
  4. What files and method is generally used for moving files or finished work from development to production?



    Some of these might be basic questions, but need to see what the members on this forum do when it comes to developing and going live…what stages do you use prior to deployment?

[quote name=‘sellon’]Before I start my development and production going, just wanted to ask this question on the forum in regards to the best practice setup.



What is the best practice or cs-cart recommened setup for development and production servers?


  1. Should development be done on local setup or doesn’t matter?
  2. How is license shared or works if you have 2 or 3 environments?
  3. What is the best practise approach to production?
  4. What files and method is generally used for moving files or finished work from development to production?



    Some of these might be basic questions, but need to see what the members on this forum do when it comes to developing and going live…what stages do you use prior to deployment?[/quote]


  5. Development = “Live Server”

    → PHP, Smarty, Mail, File Permissions, CSS changes

    All of these components differ between your local machine and your webhost. It’s effectively the same as though you developed a program for WindowXP and expecting it to run on Windows 7 without issue. Make sure it runs on the server before venturing further.


  6. You can use as many “development” installations as you want. These development installations must be inaccessible to the public via htaccess login or other method. The CS-Cart license agreement refers to one PRODUCTION/LIVE server per license, don’t consider using one license for two production servers as they don’t respond kindly to theft (relatively so, buy a license if another store is going up)


  7. Test. Test. Test. Nothing more that I can say here unless you give a more detailed description of what you plan to do. ie: Mods, Skin Development, Hacks, Design Changes, Images etc.


  8. If you are already using the “development” server on your “server” → remove the htaccess login. OR in the case of moving between databases/domains, then change config.local.php to reflect the new changes.

[quote name=‘JesseLeeStringer’]1. Development = “Live Server”

→ PHP, Smarty, Mail, File Permissions, CSS changes

All of these components differ between your local machine and your webhost. It’s effectively the same as though you developed a program for WindowXP and expecting it to run on Windows 7 without issue. Make sure it runs on the server before venturing further.



2. You can use as many “development” installations as you want. These development installations must be inaccessible to the public via htaccess login or other method. The CS-Cart license agreement refers to one PRODUCTION/LIVE server per license, don’t consider using one license for two production servers as they don’t respond kindly to theft (relatively so, buy a license if another store is going up)[/QUOTE]



Thanks for the suggestions on my questions.



Ok, so my understanding is that all development and production work takes place on the webhost and method(steps) is is follows:


  1. I have 2 enviroments on webhost; ‘development-location A’ and one for ‘production- Loction B’…correct?
  2. I do 2 installs of CS-Cart in location A & B on my webhost
  3. I then do my development work on A, create, fix, test and get it right on the ‘live’ development server.
  4. I then copy the changed files to location B prior to going live…correct? Or I am I wrong in this stage?

    4b. questions - how do I keep track or know which files to copy from A to B?



    Local PC Host - Secondly, the other confusing bit for me is to understand what is the purpose and idea of having a local install on my PC, can’t I do my hacking and development on the local install or will this not work once I move to the webhost?



    My local PC/enviroment is Windows XP and my webhost is a Linux environment.

[quote name=‘sellon’]Thanks for the suggestions on my questions.



Ok, so my understanding is that all development and production work takes place on the webhost and method(steps) is is follows:


  1. I have 2 enviroments on webhost; ‘development-location A’ and one for ‘production- Loction B’…correct?
  2. I do 2 installs of CS-Cart in location A & B on my webhost
  3. I then do my development work on A, create, fix, test and get it right on the ‘live’ development server.
  4. I then copy the changed files to location B prior to going live…correct? Or I am I wrong in this stage?

    4b. questions - how do I keep track or know which files to copy from A to B?



    Local PC Host - Secondly, the other confusing bit for me is to understand what is the purpose and idea of having a local install on my PC, can’t I do my hacking and development on the local install or will this not work once I move to the webhost?



    My local PC/enviroment is Windows XP and my webhost is a Linux environment.[/QUOTE]

    That is the problem - your development and production environments are different. You will save yourself some frustration by developing in the same environment as your production site.



    One thing you omitted is that you must secure your development site so that it is not available to internet users. You can add a password to the directory for the development site.



    There are several comparison tools which will help you identify and move changed files. These include Dreamweaver and Beyond Compare. I’ve used both in the past and prefer Beyond Compare and consider it a great value for Windows users. There are free tools available, as well, like WinMerge for the PC and FileMerge for the Mac.



    Bob

[quote name=‘jobosales’]That is the problem - your development and production environments are different. You will save yourself some frustration by developing in the same environment as your production site.



One thing you omitted is that you must secure your development site so that it is not available to internet users. You can add a password to the directory for the development site.



There are several comparison tools which will help you identify and move changed files. These include Dreamweaver and Beyond Compare. I’ve used both in the past and prefer Beyond Compare and consider it a great value for Windows users. There are free tools available, as well, like WinMerge for the PC and FileMerge for the Mac.



Bob[/QUOTE]


  1. Yes, I see it as a problem given I am not a developer as such and if I have no idea of tracking changed files, I can see it being a messy situation trying to have the production site replicated correctly.


  2. If the dev/prod is on the same site/location, if there way to password protect the directory through CS-Cart or are you suggestion this be done using the Linux directory tools/cPanel?


  3. I shall checkout some of the suggested comparison tools.



    I hoping to hear from other forum users as to how they approach development & production. I am sure there is a best practice approach that works for all, however, I do understand people will have their own preferred methods depending on skill levels as some are dedicated developers and some of us are shop owners trying to develop a shopping cart solution.

[quote name=‘sellon’]2. If the dev/prod is on the same site/location, if there way to password protect the directory through CS-Cart or are you suggestion this be done using the Linux directory tools/cPanel?

[/QUOTE]

There is an option in cPanel to set a password for directories.



Bob

[quote name=‘jobosales’]There is an option in cPanel to set a password for directories.



Bob[/QUOTE]



Yes, thanks for that Bob in regards to cPanel security.



Is there any point of having a localhost setup if all of these could be setup in the webhost environment?



Why have a localhost setup…do people use this for testing as well…love to hear how you guys are setup.!

If dev site is online, you will most likely be constantly downloading to your local pc, making changes using desktop design programs, then reuploading to your server to test your changes, so it would make more sense to actually have your dev site installed locally to save time. Then after you are satisfied with the changes, you can upload to your production server.



Same with upgrades, you can upgrade your local install, then upload to production server when finished testing. Basically you could mirror your local dev & production server installs.



You may find this useful as well:



[url]http://www.apachefriends.org/en/xampp.html[/url]

[url]http://www.installationwiki.org/XAMPP[/url]

[quote name=‘Struck’]If dev site is online, you will most likely be constantly downloading to your local pc, making changes using desktop design programs, then reuploading to your server to test your changes, so it would make more sense to actually have your dev site installed locally to save time. Then after you are satisfied with the changes, you can upload to your production server.

[/QUOTE]



Struck,



Thanks for the info and the links, that’s great.



Just a few further questions:


  1. If I am doing a fresh install to have my environments setup, should I install the production server first followed by localhost or does it not matter?


  2. When you upload changes made on dev on local, do you upload the whole folder generally or do you just upload changed files?



    Sorry, some of these questions might be basic, but I just want to make sure I’ve setup my procedures correctly from day 1 to avoid future rework…

Anyone got suggestions or answers on my last post…?

[quote name=‘sellon’]Struck,



Thanks for the info and the links, that’s great.



Just a few further questions:


  1. If I am doing a fresh install to have my environments setup, should I install the production server first followed by localhost or does it not matter?


  2. When you upload changes made on dev on local, do you upload the whole folder generally or do you just upload changed files?



    Sorry, some of these questions might be basic, but I just want to make sure I’ve setup my procedures correctly from day 1 to avoid future rework…[/QUOTE]



    Anyone got any suggestion for my last 2 question…

1.) It doesn’t matter either way. As long as you select the same skin and settings everything else will be the same.



2.) I only upload the files I change. I don’t see any point of uploading files that haven’t been changed.



Hope that helps,



Brandon

Hi,



Further to this thread regarding setting up development & production environments, I would like to know what is the best way to setup database for the 2 environments.



I have setup the 2 instances(installs of CS Cart) on my webhost. One in development directory and the second is in the root folder(for production).



Once I am done with my development work, I will copy the changed files to production before going live…that’s the plan!!



Database setup questions:

What is the suggested approach to using databases in these 2 environments?

  1. Should I use the same database(1 dbase) in both environments? or;
  2. Should I have one database for production and one for development?



    If I have 2 different databases for the 2 environments, when I move/copy files from development to production:
  3. do I need to change any config files or another files to reflect the different database names?



    Thanks.

I have a SVN setup for development. I have a repository checkout on a sub-domain of the main domain for testing. I edited my config file so if it detects the subdomain it uses one db connection, if it detects it’s localhost, it uses another, and in neither, it uses production db.



When I upgrade I’ll do it on the development version, then do a check-in, then update all the files with our mods, then do another check-in. Then when I’m ready to make it live, I’ll do the automatic upgrade on the live site so it does any database changes and what not, then I’ll do an export of the repository to like public_html_new. Followed by:

“mv public_html public_html_old; mv public_html_new public_html”

So the site is switched over very quickly.

[quote name=‘sellon’]

Database setup questions:

What is the suggested approach to using databases in these 2 environments?

  1. Should I use the same database(1 dbase) in both environments? or;
  2. Should I have one database for production and one for development?

    [/QUOTE]


  1. If you use a single database, then, depending on how major the upgrade is, there could be issues. Suppose you do a upgrade on a development install, and it changed the database dramatically, it may no longer be compatible with the live site.


  2. If you have two, then you need to make sure the live db is updated when you copy over the new development files into production. You can make sure of this by doing the auto upgrade on the live, which will update the db, then copy over the production files.





    For example, currently our live site is running 2.0.15, but in our dev, we are running 2.1.1. I’m going to make 2.1.1 live in a couple days. While I was upgrading the dev, I wrote down all the settings changes I made in the admin section since those have to be done manually. I also edited all the files to make sure our mods worked properly. When I go to upgrade the live site, I’m going to go the the upgrade section, tell it upgrade to 2.1, then upgrade to 2.1.1. That will make sure the db is updated. Then I’ll delete all the old files and copy the dev files in their place.



    As I said in my last post, I have the config file auto detect which db to use based on environment.

[quote name=‘phazei’]I have a SVN setup for development. I have a repository checkout on a sub-domain of the main domain for testing. I edited my config file so if it detects the subdomain it uses one db connection, if it detects it’s localhost, it uses another, and in neither, it uses production db.



When I upgrade I’ll do it on the development version, then do a check-in, then update all the files with our mods, then do another check-in. Then when I’m ready to make it live, I’ll do the automatic upgrade on the live site so it does any database changes and what not, then I’ll do an export of the repository to like public_html_new. Followed by:

“mv public_html public_html_old; mv public_html_new public_html”

So the site is switched over very quickly.[/QUOTE]



Thanks phazei for the insight into your SVN setup and suggestions on database setup also, great stuff.



Sounds like a good but sophisticated SVN setup for my entry level understanding. But it’s good to know how things could be setup and certainly something I will need to setup in future once I’ve got some basic understanding. For now I am going to attempt manually in 2 folders(dev & prod) and use file comparison software as suggested by ‘jobosales’ earlier.



Any suggestions on good/free file comparison software for linux environment?

[quote name=‘sellon’]Thanks phazei for the insight into your SVN setup and suggestions on database setup also, great stuff.



Sounds like a good but sophisticated SVN setup for my entry level understanding. But it’s good to know how things could be setup and certainly something I will need to setup in future once I’ve got some basic understanding. For now I am going to attempt manually in 2 folders(dev & prod) and use file comparison software as suggested by ‘jobosales’ earlier.



Any suggestions on good/free file comparison software for linux environment?[/quote]

[quote name=‘JesseLeeStringer’]beanstalkapp.com[/QUOTE]



Looks like you have to host with them to use this feature!



I have already got my webhost provider. :slight_smile:



Thanks anyway.

Haven’t tried these but:



[url]http://meld.sourceforge.net/[/url]

[url]http://kdiff3.sourceforge.net/[/url]





Meld looks prettier, simpler. kdiff has more features and will do directory compare, also supports 3-way compare. So it’s similar to UltraCompare (for windows) in that way.



Beyond Compare also looks pretty awesome, but it’s commercial.

I have a question on this. I have a production site at www.domain.com and a development site at dev.domain.com. When I initially set the site up I chose to rename the admin panel. Now when I try to go to dev.domain.com/adminpanel it redirects me to www.domain.com/adminpanel. My SSL is for www. or domain.com only of course. How can I keep it from redirecting?



Thanks