Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 100933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:40:26+00:00 2026-05-11T00:40:26+00:00

In standard php or source code based projects we easily keep all of the

  • 0

In standard php or source code based projects we easily keep all of the code in SVN and each developer can checkout their own copy and collaborate on the same code.

When developing a Drupal site however, much of the work is in ‘setup’. Besides the theme and modules you don’t really have any ‘source code’. How do you run multiple instances of the same site so developers can all work at the same time yet share their work?

Example Scenario:

We launch an initial version of a Drupal site with content type ‘X’ created. We also initially launch a view on the site that lists all the nodes of type ‘X’ in chronological order. The client starts using the site, add content, menu items etc.

The next release is planned to add user search ability to that view. The setup for that is contained in the database though. We can copy down the production database to our development version to get the latest data while we work on changing the view. During that time however the client can still be updating the site, making our dev database out of sync. When we are ready to push the new view to production, is there an easier way to do it other than manually repeat the steps to set it up on the production install?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T00:40:27+00:00Added an answer on May 11, 2026 at 12:40 am

    I think a good strategy here is to use the install profile API. With install profile API you can do most things that using the Drupal admin tools do. Most core forms simply set variables in the variables table. To be able to sensibly version your non content database contents i.e. configuration it is wise to use update functions.

    On my site we have on module ‘ec’ that does very little apart from have it’s ec.install file contain update functions e.g. ec_update_6001()

    Your main install function can take care of actually running the updates on any new installs you make to bring your modules up to date.

    function ec_install() {   $ret = array();   $num = 0;   while (1) {    $version = 6000 + $num;    $funcname = 'ec_update_' . $version;    if (function_exists($funcname)) {      $ret[] = $funcname();      $num++;    } else {      break;    }   } return $ret; } 

    A sample update function or two from our actual file now follow

    // Create editor role and set permissions for comment module function ec_update_6000() {   install_include(array('user'));   $editor_rid = install_add_role('editor');   install_add_permissions(DRUPAL_ANONYMOUS_RID, array('access comments'));   install_add_permissions(DRUPAL_AUTHENTICATED_RID, array('access comments', 'post comments', 'post comments without approval'));   install_add_permissions($editor_rid, array('administer comments', 'administer nodes'));   return array(); } // Enable the pirc theme. function ec_update_6001() {   install_include(array('system'));   // TODO: line below is not working due to a bug in Install Profile API. See http://drupal.org/node/316789.   install_enable_theme('pirc');   return array(); }  // Add the content types for article and mtblog function ec_update_6002() {   install_include(array('node'));   $props = array(     'description' => 'Historical Movable Type blog entries',   );   install_create_content_type('mtblog', 'MT Blog entry', $props);   $props = array(     'description' => 'Article',   ); install_create_content_type('article', 'Article', $props); return array(); } 

    Effectively this mostly solves the versioning problem with databases and Drupal code. We use it extensively. It allows us to promote new code which changes database configuration without having to reimport the database or make live changes. This also means we can properly test releases without fear of hidden database changes.

    Finally cck and views support this approach. See this code snippet

    // Enable CCK modules, add CCK types for Articles in prep for first stage of migration, // enable body for article, enable migration modules. function ec_update_6023() {   $ret = array();   drupal_install_modules(array('content', 'content_copy', 'text', 'number', 'optionwidgets'));   install_include(array('content', 'content_copy'));   install_content_copy_import_from_file(drupal_get_path('module', 'ec') . '/' . 'article.type', 'article');   $sql = 'UPDATE {node_type} SET body_label='Body', has_body=1   WHERE type = 'article'';   $ret[] = update_sql($sql);   return $ret; }  
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 191k
  • Answers 191k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If the validity of the state of the form is… May 12, 2026 at 6:08 pm
  • Editorial Team
    Editorial Team added an answer You might want to try Cargo. You can use ant… May 12, 2026 at 6:08 pm
  • Editorial Team
    Editorial Team added an answer You don't. Due to type erasure that information is (mostly)… May 12, 2026 at 6:08 pm

Related Questions

I'm looking for a good framework on which to base my applications development. In
How do you prepare your SQL deltas? do you manually save each schema-changing SQL
In my copious free time, I collaborate with a number of scientists (mostly biologists)
We are looking for a way to publish articles in different languages, including differences

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.