[support] Best way to deploy Drupal.

Kathleen Murtagh kathleen at ceardach.com
Tue Jul 14 13:49:34 UTC 2009


Any value stored in the variables table can be set in code.  Read the bottom
of the settings.php file for details of implementation.  Many many many
modules store their values here.

For your custom modules, you can set all your default variable values in
code.  Then, any time you need to change that default value, you'll do it in
code rather than performing an action that would effect the database.

Read through the API of the contributed modules and see what you can use.
Use provided hooks whenever possible.  If necessary, you can run functions
as one-off update events.  For example, I used simplenews'
simplenews_subscribe_user() function as part of a script to initially
subscribe all users.  Othertimes I have run scripts to migrate values from
one field to another field, then delete the old field.   I don't have a
recommended best practice for automating this, but I'd look into setting up
a system that will run each script in succession and then store what point
it is at (e.g.: something like Ruby on Rails' migrations).

--
Kathleen Murtagh


On Tue, Jul 14, 2009 at 6:05 AM, Unai Rodriguez <me at u-journal.org> wrote:

> Dear All,
>
> Thank you so much for the contributions.
>
> I have classified different parts that currently compose our Drupal system
> along with a suggested method of "putting everything in code and update
> functions":
>
> a) THEMES.- We just copy the code over, there is no settings to be applied
> really
> b) VIEWS.- We will be using what is suggested here:
>
> http://treehouseagency.com/blog/steven-merrill/2008/11/05/speed-and-version-your-views
> (This is similar to what Seth sent but applied to Drupal 6 -- THANKS SETH!)
> c) MODULES DEVELOPED BY US FROM SCRATCH.- We will make sure that all the
> settings that need to be put into the database are being updated on the
> hook_update function. Ideally these settings could come from a
> configuration file in php. We will use DRUSH to invoke our update.php upon
> deployment, as suggested by Kathleen.
> d) 3rd PARTY MODULES (aka contributed modules by the Drupal Community).- I
> am not sure how to proceed with this one; for now I am trying to check if
> the modules that we use implement the hook_update function and modify if
> possible so the settings get loaded from configuration files, similar to
> (c).
>
> My questions are:
>
> 1) How would you handle (d)? What I have now in mind seems a bit tricky...
>
> 2) What do you think of the classification? Am I missing something? Does it
> make sense?
>
> Thank you so much.
>
> With Best Wishes,
> unai
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.drupal.org/pipermail/support/attachments/20090714/5d7a080a/attachment-0001.htm>


More information about the support mailing list