How can I develop a site where the production site is the master copy?
For decades I have developed systems by buiding a prototype on my computer, then upoading to a server.
However, in this new Drupal site I can not do that. Because of user blog data, I must not replace the version on the server.
The best I can understand things is that I must do this:
[1] Create a backup of the production server site.
[2] Load that backup onto my development computer.
[3] Make changes on my development computer, and LOG ALL CHANGES to a text file.
[4] When it is ready, log in to the server and REPLICATE ALL CHANGES to the production server site.
[5] After testing, throw away the version on my development computer.
Is this how you evolve a site? Because I've never worked this way before and it seems to triple the amount of work involved.
Comments
Features Module
Features Module is a popular choice to apply changes to the production website from a TEST environment. I personally don't have much experience using it yet as we don't have much update work on existing website and I'm dying to know more too!
Features Module
http://drupal.org/project/features
First of the 4 part Youtube series discuss on Features module.
http://www.youtube.com/watch?v=_iAHwZU6VNU
Kelvin Lee
Onion Creative
Twitter: @KelvinLeeHK | @OnionCreativeHK
Google+: +Kelvin Lee
AEGIR
You can set up an aegir environment.
That's what I did for some clients infrastructure. They often need new sites based on a similar structure.
Features, strongarm, context are used to replicate the structure for new sites. Sites are moved from dev to prod using the aegir infrastructure.
Useless to say that Linux admin are required to do so. It is not for newbies. But that is the way to do it.
Otherwise this can be done manuallyat copying the site files and db on the hosting server.
Julien MARY
AFAIK can not be done manually
Quote: Otherwise this can be done manuallyat copying the site files and db on the hosting server.
The problem is that it can not be done manually. Copying the site files does not update the site information stored in the database. Copying the database destroys user data such as blog contents and event calendars. The problem is to alter the site features without altering the user content.
On LAMP systems there is a clean difference between the PHP site features and the MySQL user data; I can update one without touching the other. Drupal mixes the two together in the database.
I will look into 'aegir'. Thank you.
Aegir can only really help
Aegir can only really help speed up tasks like moving sites around, or running security updates without supervision. I think it's only a good solution if you've got a lot of sites (like more than 20). Nor does it address the OP's original question of how to do incremental site improvements.
I agree witht the suggestion from sourcesqr: Features module is the best tool at your disposal. If you are using the core block system (as opposed to Context or Panels modules), you'll need Features Extra module as well.
--
Dave Hansen-Lange
Director of Technical Strategy, Advomatic.com
Pronouns: he/him/his
Features and Features Extra
So I install Features and Features Extra. I'l target those two.
Question regarding Features: It does not seem to handle themes. So after I change sites/all/themes/mytheme/css/pages.css or sites/all/themes/mytheme/templates/block.tpl.php, I have to upload those files in a separate manual step. Yes?
Features is used for getting
Features is used for getting site configuration from the database into the file system. Then it's best practice to manage your files with a version control system like SVN or Git (I'd recommend the former if you have no prior experience with version control). You can get hosted version control for free from several places on the Internet. You'd then commit the code changes on your dev site to the version control system, and update the production site (and possibly have a staging site in the middle).
Something like:
1) Change a file on dev, either via Features, or manually editing some .css file for example.
2) Commit to version control (ex.
svn commit -m"Added thick border to front-page main article block")3) On production update the code (ex.
svn update)As an aside, part of the reason that there is no clear boundary between configuration and user-created data in Drupal is because that is very site-specific. On some sites blocks, flags, nodequeues, etc. could all be user-created data.
--
Dave Hansen-Lange
Director of Technical Strategy, Advomatic.com
Pronouns: he/him/his
Subversion - where?
OK, I'll dig into subversion. I have to install subvsions. Extremely ignorant question: where? The production server is OS X, my development machine is Ubuntu Linux. Do we install it both places? No sense in installing the code and documentation until I know which machine gets the goodies.
Some precisions
What is explained in the initial post is the most silly way to proceed = to redo all the work.
Julien MARY
Updating via FTP fails
I haven't installed Features yet because I am still trying to get the site on the production server to handle module updates. The insanity comes after the update process downloads the *.tar.gz file to the production server and then wants FTP access to the production server. The hostname is "localhost". But we are trying to figure out how to handle the user name and password and access. I can find no documentation on exactly what Drupal wants in this regard.
The i18n module is at "/Users/andy/organic-asia/GSite/pc/sites/all/modules/i18n". So the ftp update process tries to cd to /Users/andy/organic-asia/GSite/pc/sites/all/modules/i18n and fails because all FTP accesses are relative to /Library/WebServer/Documents. I created a directory /Library/WebServer/Documents/Users and symbolic link from /Library/WebServer/Documents/Users/andy to /Users/andy, but the FTP server refuses to follow the symbolic link.
We can create a special FTP account "rootax" which has "/" as it's FTP directory. But can ftp user "rootax" update files owned by user "andy"? Probably not.
How does Drupal expect this FTP user to be configured?
ONE LAST BIT: THANK YOU ALL FOR YOUR RESPONSES.
I think you are trying to use
I think you are trying to use the Drupal 7 feature where Drupal updates itself from within the GUI? Sorry I can't help you there. If you enough knowledge that you can create symlinks, then doing an update via the GUI is probably not for you. I'd recommend switching to have a dev site separate from the production site and using version control to move updates to production.
--
Dave Hansen-Lange
Director of Technical Strategy, Advomatic.com
Pronouns: he/him/his
May I suggest
I think many of us have the same dilemma to a certain extent on either using Features to increment changes on existing sites, or using SVN as part of the workflow for version control interacting with Production environment (not on local machine tho).
May I suggest to bring these topic to Drupal meetup in the next few months? :)
Kelvin Lee
Onion Creative
Twitter: @KelvinLeeHK | @OnionCreativeHK
Google+: +Kelvin Lee