Importing settings

Created on 15 May 2024, over 1 year ago

Problem/Motivation

I want to transfer theme settings of another - older - instance. Other than there, there is no export/import on the current theme settings page.

Configuration export/import shows many parts attributable to DXPR theme.

I'd assume that the old settings need to be broken up and transformed into yml format.

Please advise how to proceed.

๐Ÿ’ฌ Support request
Status

Active

Version

5.2

Component

User interface

Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany thomas.wardin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @thomas.wardin
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ravi kant Jaipur

    @thomas.wardin

    You can manually update theme setting in config/instaall/xxx.settings.yml of your theme before enable and make default.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany thomas.wardin

    Is this really the case?

    The old instance's export looks like this:

    settings[toggle_logo] = 1
    settings[toggle_name] = 0
    settings[toggle_slogan] = 1
    ...
    settings[palette][silver] = "#f1f1f1"
    settings[palette][body] = "#efefef"
    

    Wouldn't it be necessary to transform into yml?

  • ๐Ÿ‡ง๐Ÿ‡ฆBosnia and Herzegovina drale01 Sarajevo

    In Drupal 7, theme settings were stored in the .info file using the settings[...] format, for example:

    settings[toggle_logo] = 1
    settings[toggle_name] = 0
    settings[toggle_slogan] = 1
    settings[palette][silver] = "#f1f1f1"
    settings[palette][body]   = "#efefef"
    

    In Drupal 8+, these settings must be stored as configuration in YAML format, for example in:
    config/install/dxpr_theme.settings.yml

    toggle_logo: true
    toggle_name: false
    toggle_slogan: true
    palette:
      silver: '#f1f1f1'
      body: '#efefef'
    

    You can manually convert your old .info settings into this YAML format and then either:

    • place the file in your themeโ€™s config/install/ directory before enabling the theme, or
    • import it via drush cim if the theme is already enabled.
  • ๐Ÿ‡ง๐Ÿ‡ฆBosnia and Herzegovina drale01 Sarajevo
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany thomas.wardin

    What do you recommend for automated conversion?

    Or does "fixed" mean, the new importer now understands the old format?

  • ๐Ÿ‡ง๐Ÿ‡ฆBosnia and Herzegovina drale01 Sarajevo

    Hi @thomas.wardin,

    There is no good automated conversion tool for the old Drupal 7 settings[...] format from .info files to the YAML configuration format used in Drupal 8+.
    โ€œFixedโ€ in this context does not mean that the importer now understands the old format โ€” it only means that the manual process has been documented.

    The recommended approach is still to manually convert the old .info settings into {theme_machine_name}.settings.yml as shown above, and then either place it in config/install/ before enabling the theme or import it with drush cim.

  • ๐Ÿ‡ง๐Ÿ‡ฆBosnia and Herzegovina drale01 Sarajevo
Production build 0.71.5 2024