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 Answers
There are several tools available to make this easier. Some benefit greatly from being applied, while some can be added in hindsight without issues.
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.
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.
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.– HackerCommented Jan 11, 2012 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. Commented Jan 11, 2012 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. Commented Jan 11, 2012 at 11:44
- Copy your files.
- Copy the DB, backup & migrate module is very useful here.
- Adjust settings.php to your new site
- Install and configure the new language
- Change the images to your needs.
Done.
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.