简体   繁体   中英

Programmatically create a whole Drupal site

I am going to start a new project and I would like to avoid the tedious tasks necessary to recreate and populate a site with all the custom content, modules and functionality.

My idea is to create PHP scripts (similar to the installation scripts in the profile folder) to populate users, content, menus, views, etc. In this way you can execute the scripts and rebuild the whole site from scratch.

Do you know any tool/documentation to do this?

You should have a look at drush make , which is part of the very helpful drush command line shell & scripting interface for Drupal.

You can generate a starting makefile from an existing Drupal installation using:

 drush make-generate /path/to/make-file.make

.. and then tweak the configuration as needed, including custom file/module downloads.

Well, you can always build new profile that will help you build new web-sites. Please look at How to Write a Drupal 7 Installation Profile . Its simular like building new module (documented).

For our needs in the company, we've build 2 type of profile installation but sometimes it was more worth to copy existing site and install it on new domain. But I assume that our needs are different then yours.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM