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 helpfuldrushcommand line shell & scripting interface for Drupal.You can generate a starting makefile from an existing Drupal installation using:
.. and then tweak the configuration as needed, including custom file/module downloads.