Migrating themes

Migrating your Adaptivetheme subtheme is a little different to most other themes because it generates some of its dependent files, such as the layout and responsive CSS files. In the case where your theme uses the color module you will also need to account for saved color CSS files.

There's a few things to think about and check before migration. You should definitely read the help page on Generated Files, pay special attention to the information regarding .info files and how the generated info file can be used to save and migrate your theme settings - this is especially useful if you cannot migrate the database but need to retain the themes configuration.

Migrating Generated Files

Adaptivetheme 7.x-3.x allows you to choose where these are saved. By default they are saved in public files, for example: sites/all/default/files/adaptivetheme/my_themes_files. Note that you can also choose to save these files to an alternative directory - if you have done this the migration steps are the same as for files saved to public files.

You can also choose to save these in the actual theme folder, in which case they are in a directory such as: sites/all/themes/my_theme/generated_files

Whatever option you have chosen you ideally should migrate these folders and files as well. Strictly speaking you do not have to and you can generate these files again - however you must either migrate the database or use the saved info file settings as described in the help page on generated files, read the section titled "What about this info file?".

Color files

Most AT sub-themes, such as the commercial themes or our free contrib themes use the Color module. When you choose a different color scheme or create a custom color scheme data is saved to the database and new color CSS files are generated. These are always saved in sites/all/default/files/color/my_themes-fae14b07, where the suffix is a hash and generated every time you save the color scheme.

If you are using a custom color scheme you should migrate the database - that is the safest way to ensure your color scheme is preserved across Drupal installations. There is however an alternative approach if you cannot migrate the database. Again see the docs on generated files, look under the section "What about this color inc file?". You can use the generated color inc file to include your custom color scheme in code.

Rounding up

As a check list:

  • Migrate the theme
  • Migrate the generated files
  • Migrate the color files if using Color module
  • Ideally migrate the database, if not make use of the info and color inc generated files

Last updated 31st July, 2012 - 4:08am