I have customized CiviCRM (translation, custom fields, module, view, report, menus, etc.) and I want to reproduce the configuration. What is the best way to go?
That's a good question that should have a canonical answer but doesn't.
Here's a recent similar question and answer: method for versioning configuration of civicrm?
I suspect there are other good references out there, please add them here.
Part of the challenge, which is not unique to CiviCRM, is that the definition of "configuration" can be grey in some areas.
Here is a list of tools and techniques that can capture and copy some parts of commonly considered "configuration":
1: The civicrm_domain and civicrm_setting tables.
You can back up these two tables and then restore them to a different site. This is a hack and could get you in trouble, but worth trying. Between the two of them, you've got most of the core "settings" type values.
2: Build your own extension to save your custom fields.
The instructions for building your own extension using civix show you how to generate an extension that saves the configuration of your custom fields.
3: civicrm_report_instance table
This can be backed up and restored on it's own, it's fairly safe.
4: civicrm_extension table
This is the list of installed extensions with configuration. You'll need to also have the matching extension directory.
5.1: Extension: org.civicoop.configitems
This extension allows you to export some site configuration to JSON, which you can package as a related custom extension for your site. (See also Jaap's answer on this question.)
5.2: Extension: CiviConfigure (eu.tttp.setting)
There's an extension which appears to be designed to solve this problem for settings (may not handle eg Contribution Pages which are entities?), but it's out of date, here:
5.3: CiviCRM Config Export (nz.co.fuzion.configexport)
Imports/exports config & entities to YML.
A script you can use to export option values and tags and such. Assembly requied.
You can use the api to retrieve and set various entities, e.g. using the cv tool.
8: CiviCase specific
For CiviCase, one of the original arguments for using external files was for versioning and managing dev/production. You can still use xml files for its config.
I've left this as an open community wiki and encourage others to add to this list.
Usually I copy the site that is the best way to ensure all things are correct. But I can imagine that is sometimes cumbersome.
I have therefor used an extension org.civicoop.configitems (https://github.com/CiviCooP/org.civicoop.configitems)
An example configuration is stored in https://github.com/CiviCooP/nl.roparun.generic that configuration could be loaded with the config items extension.
This does not stores everything but at least it is a start.
@bass Can you just make a copy of the civicrm database to initialize your new instance? Unless your issue is to 'merge' this configuration into another existing instance, in which case all comment so far do apply.
@japp Congrats on a well rounded extension. What are the pros/cons of this extension vs the managed entities mechanism (https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_managed/)?