Import/Export Configuration Files

Users must have the Site Builder role to use this feature

What is SiteFarm Configuration Import/Export?

This is a module that will allow users with the Site Manager/Site Builder role combination to create custom blocks, webforms, and views, and then export a configuration file through a user interface that can then be imported into one or more separate sites. The benefit to you is the shortcut of not having to spend time duplicating work.

Risk Management

Using the Configuration Import/Export feature exposes a site to permanent damage and loss. At a minimum, you should create a database back-up of your site prior to importing a configuration file into a site in the event something goes wrong.

What can you import/export?

Users can share the following configuration types across sites:

  • Webforms
  • Views
  • Custom blocks

Why are you unable to import/export custom content types?

This option was discussed, but ultimately determined to be unfeasible due to the complexities related to the structured content and possible referenced entities (Taxonomies, fields from other custom content types, blocks, or webforms) resulting in errors on import. 

 

How to enable and use SiteFarm Configuration Import/Export

  1. Note: You must be a Site Builder to use this feature.
  2. On your target site where you will eventually import your configuration, first build any entities your configuration will be relying upon, such as content types, taxonomies, block fields, etc. This is necessary so your import won't fail.
  3. On your source site, navigate to Manage » Extend.
  4. Type Config Import and Export in the search/filter box. Check its corresponding checkbox.
  5. Scroll to the bottom of the page and click the Install button.
  6. After receiving the confirmation message of a successful installation, then navigate to Manage » Configuration » Development section and check for a link entry titled SiteFarm Configuration Import/Export. If you don't see it, please clear your site's cache, then return to this page. Click the link or, if it still doesn't display, please contact the SiteFarm team for assistance.
  7. Export a configuration
    1. Select the Configuration type, which includes Webform, Block, or View.
    2. Choose from the available list related to your selected type.
    3. When the Configuration details are displayed in the Here is your configuration: window, copy and paste ALL of the provided configuration information, preferably to a plain text document or code editor for safekeeping.
    4. Open your target site and, as necessary if the module isn't already enabled, repeat steps 2-5 above, then skip to step 8.
  8. Import a configuration
    1. On your target site, navigate to Manage » Configuration » Development section » SiteFarm Configuration Import/Export.
    2. Select the Configuration type matching the file type you exported from your source site.
    3. Copy and paste your configuration file text into the Paste your configuration here* window.
    4. Scroll down and click the Import button.
    5. If the import is clean, proceed to verifying that your new configuration item is available for use. If you receive an error, please check the Troubleshooting list below.

 

Troubleshooting

  1. You received a "The configuration cannot be imported because it failed validation for the following reasons:" message followed by:
    • Configuration XXXX depends on the XXXX extension that will not be installed after import.
      • A module that was installed and in use on the source site isn't installed on your target site. Verify in Manage » Extend if the module is installed. 
        OR
    • Configuration XXXX depends on the XXXX configuration that will not exist after import.
      • You first need to build all the components your configuration file relies upon to function, then you can import your configuration file. This may mean first constructing your block, taxonomy, content type, etc. before the import can take place.
  2. On enabling your module, you received the Temporarily Unavailable screen.
    • First, try refreshing your browser screen. Second, try clearing your site cache.
  3. When you navigate to Manage » Configuration » Development section the SiteFarm Configuration Import/Export link isn't there.
    • Clear your site's cache and check again.