When working on a project, we use SVN to keep track of code changes among developers and themers. When I make a change in file A, someone could just update their code checkout and they will have the same code as I have. SVN makes it a lot easier for people to synchronize their code and makes sure that everyone is on the same page. However, code changes are not the only thing that we have to worry about when developing a Drupal website. What about database changes? What would be the simplest way to keep track of database changes, such as settings of a module?

Write an update script. Update scripts allow you to keep track of database changes by piggy backing of off SVN (or other version control software). When you make a database change, write a script and commit it. All your team members have to do is update their code checkout and run the script. This way, the changes that you have made on your local machine will essentially be carried over the next. However, writing an update script is very cumbersome. Imagine if you have a site that has at least 4 roles on top of Drupal's default and permissions that need to be configured. As the site development progresses and more contributed modules get installed, the more update scripts you have to write in order to configure Drupal's roles and permissions.

Do not fret because the Features module is here to save us. Features allows us to export Drupal roles and permissions and package it as a module that we can just install. It makes our custom roles and permissions a “feature” of the site that we are working on. This eliminates the writing of redundant scripts just to propagate user permission configuration during the development life cycle. All you have to do is write one script that would enable this module and you are all set. You can just re-export the permissions and commit the changes to the code repository to propagate further changes. Isn't that cool?

Here are the steps to take in order to export your user roles and permissions:

1 .Navigate to admin/build/features

2. Click Create feature tab

3. Enter the feature/module name and description. Version and URL of update XML is optional.

4. Select Roles under Edit components drop down box

5. Select the roles that you want to export.

6. Again under Edit components drop down box, select Permissions

7. Select the permissions you want to export

8. Click Download feature

After this, just write an update script that would install features module that you just exported and you are good to go.

Read Next

Run Java Applications as Windows Services - Java Service Wrapper

10 March, 2011|3 min
Get in touch and let’s get started.

We are a full service digital consultancy with experience and capacity to meet the needs of even the largest most complex of organizations in the world. Our services portfolio enables us to offer clients the best of experiences when working with our teams so as to make sure we keep the focus on their needs, customers and delivering tangible value to the business. End to end services; endless ideas. 

Three easy ways to get in touch. Complete the form to request a consultation, email us your inquiry, specs and/or RFP to contact@appnovation.com OR call one of our many, global office locations and tell us how we can help.