1

I have an existing website in Drupal, say abc.com, and it's in english. Now I want to quickly build this website for different domains. The layout remains same, but the language and images may change. How can I do this and how quickly can it be done? Should anything be done on the first site so that building the second site becomes easy like profiling or something?

3

There are several tools available to make this easier. Some benefit greatly from being applied, while some can be added in hindsight without issues.

  1. Drush make, allows you keep a file with the definition of which modules, their versions, any patches etc, you need to build your site. This then makes it easy to quickly pull in all the modules again when you need to set up a new site. It also happens to be very useful whenever you need a workflow that includes patched modules.

  2. Features on the other hand, allows you to take the configuration you make with your modules, such as Views, Panel Pages, Contexts and more, and export it to a module. To some extent, this module requires you to have thought about features from the beginning. Some things, blocks and their settings for example, cannot readily be exported this way, meaning that those will either need to be manually configured after the new site is setup, or be replaced by something. I use Panels content panes in place of blocks, largely for this reason.

  3. An Install profile finally allows you to tie number one and two together. In the install profile, you first define dependencies on a few core modules, then on all your features, and finally on any other modules you need, that aren't pulled in by features. Then when you run the install, all of your modules will be enabled automatically. This part can easily be done in hindsight, but then you always end up with some amount of custom work that depends entirely on your site, and can't quite be captured in another way, and needs custom code to run during install. This step has proven to require quite a bit of work when colleagues of mine have attempted this after the site is already built.

This approach can readily be, and should IMO be, applied already when building the site initially, but can also be used afterwards to help cloning a website. Realistically, the second will require more work than the first. It is left as an exercise to the reader to discover other cool benefits of this approach, such as how one can automatically generate demo content and more.

  • How about language change? and importing of the content also. – Hacker Jan 11 '12 at 8:19
  • Drush make is an excellent way of quickly building Drupal sites. We often use this approach to build a standard Drupal setup before moving on to the bespoke elements. Features are also good, as long as they are well thought out to start with; otherwise, you can end up in a bit of a mess. – drmonkeyninja Jan 11 '12 at 10:11
  • 1
    @Hacker in this model, the language would be set in the install profile, but really, you could just set the language to whatever you want after the site is finished. Regarding content, I was under the impression that you wanted same site, new content. If you just want to start from an exact clone of everything, go with BetaRide's suggestion. – Letharion Jan 11 '12 at 11:44
2
  1. Copy your files.
  2. Copy the DB, backup & migrate module is very useful here.
  3. Adjust settings.php to your new site
  4. Install and configure the new language
  5. Change the images to your needs.

Done.

1

Use the Features module:

Features provides a UI and API for taking different site building components from modules with exportables and bundling them together in a single feature module. A feature module is like any other Drupal module except that it declares its components (e.g. views, contexts, CCK fields, etc.) in its .info file so that it can be checked, updated, or reverted programmatically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.