I’m beginning to really like Drupal, a PHP-based content management system. Working with Drupal feels almost like working with Emacs because of the number of hooks that people have designed into the system. =) So here’s a Drupal tip for fellow newbies.
When you’re developing a site in Drupal, it’s a good idea to make sure that you can reproduce your setup on a different system. One way to do that is to periodically do a fresh install of Drupal with your modifications, and see if everything still works.
For example, on my system, I have an installation profile that enables and sets up Drupal the way I want. I also have a script that deletes and recreates the database, then restores the default settings.php. To refresh my system, all I have to do is type “make clean”, then open my Drupal site in the browser. After I specify the installation profile for my project and the database connection details, Drupal sets everything else up. Because I use installation profiles and source code control (svn on this project), I can commit my changes, update the copy on the test server, and easily reproduce my system there. Using installation profiles saves me the time that I would’ve spent setting up and configuring all the modules (and in the right order!), and this practice can help you too.
Here’s how to get started:
Then, when you’re developing code, you can just call your Makefile/script/batch command to start from a (relatively clean) database.
Lather, rinse, repeat.