Development Cycle, Development and Production
I'm hosting my own XAMPP (Apache on Windows) server, so space and file management is flexible. I own several domain names, of which at least one can be used for development.
I have been doing all development on prod. Sad but true.
Here are some examples so you can see the scope of my question.
- Run two different physical or virtual servers.
- Run two different instances of XAMPP on one server.
- Run two sites in one instance of XAMPP.
- Run dev in corner of production: swiftsite.net/dev
- Run dev as a subdomain: dev.swiftsite.net
- Run dev as it's own domain: swiftsite_dev.net
I think all of these would work with differing costs and benefits.
My goal is ease and simplicity.
After the architecture and naming are chosen, please provide instructions on how to merge/migrate/copy/promote. Here's a hint--the architecture and naming choice that has the fewest steps will probably win.
And, to define the scope of this part of the question, here are my concerns. Which of the following do I need to muck with?
Router - IP forwarding (like in the case of different domains on different servers)
Apache - edit conf files
MySQL - copy/move/rename databases
Concrete5 - change base path, domain name, site name, association with MySQL database
BTW, I've seen variations on this question, but not asked at a high level. It might be worth putting article in the help documentation.
How do you maintain a production site, do development, and move development into production?
In your server tree you will put the production install off one level. So under you public html folder is the unpacked c5 install with blocks, concrete, config, controller, etc. In here you will want to place a folder called development or Zdevelopment if you want to make it easier to find at the bottom of file tree. In this folder you will want to unpack concrete5 the same way as it is in first level resulting in the development url beingwww.www.yoursite.com/development/...
So in the development folder you have a completely secondary version of c5 with its own database. There will also be your other copy of c5 with its own database and file structure. Now you can just close off permissions to your development site, and remove from sitemap.xml so it isn't indexed while you build, and your original version will stay live, and functioning.
When your ready to launch it you just use your file manager in your cpanel not on C5, to move up a level which will be an option in your cpanels file manager. When you do this you select all the folders included in the development folder and the development folder itself taking it up a level so its next to public html. Once they are on the same level rename public html to old site, and rename your development folder to public_html.
Voila your new development is athttp://www.yoursite.com
Its actually only a few clicks, and one folder creation so its pretty easy. To install concrete 5 initially I use the same method with unpacking a zipped version next to public html, and then relabelling the c5 folder public html. The above is also useful if you are installing to a shared server with garbage permissions, and have to unzip underneath public html. In that case you just bump it up with the file manager in cpanel. Makes every install a breeze.
This eliminates the need to move any files, folders, databases, or anything at all, and when your all said, and done you just delete the old site.
I have a couple related lower priority questions. Does it make sense to develop on one domain name, and put into production on another domain name?
I currently have one server, one implementation of WAMP (XAMPP), one implementation of C5 and several domains maintained as separated directories under the html structure. I think this is what JohntheFish was recommending in the linked thread. Thanks for that. Nice to have confirmation that I'm doing something right.
And finally, I'm wishing for a simple magic answer to this question that seems to have been answered many times: How can I migrate from one complete environment (including a full install of a WAMP (XAMPP), Concrete5, HTML directory structure) to another--in my case, on the same server. I'm not a big fan of fiddling, meaning upgrading XAMPP, upgrading Concrete5, upgrading code all on the fly. I prefer creating a fresh environment of WAMP, C5, HTML, developing it, proving it, then making it production (which I would want to be as simple as a one line redirect), but there are lots of settings across different levels that need to be tweaked.
It's okay to tell me this is a bad idea or that there is no simple magic answer to that one. ;-)
You should absolutely not be doing development on your server -- I'm not really sure why you'd need to do that since you already say you're using WAMP/MAMP/XAMP.
You might also want to look into setting up version control (SVN or GIT etc.)... I use this on my local machine and also on my staging server where I show sites to clients before they're deployed. This allows me to really easily send all updates from my local machine to the staging server (although sometimes this requires doing a database dump from one to the other as well).
For live deployment, I just copy everything to the live site. Changes after that need to be manually copied up, but these are generally rare for my situation -- only minor tweaks to some styles are usually required after a site goes live (may be different for your kind of business and clients though).
It sounds like you described exactly what I was asking for. Now I just need to work through the details. If I understand correctly, it should be easy. I'll give it a shot.
C5 sites are relatively easy to move -- just move the entire site directory (including the /files directory), tweak the config/site.php settings as needed (probably only database connection, or if you're running an older version of C5 also the BASE_URL and DIR_REL settings), and maybe the .htaccess file. Other than that you should be good to go.
Best of luck.
It'll save you some headache down the road.