Posted by thomasmurphy on September 16, 2008 at 11:46pm
Is it possible to copy all the existing block placement information from one theme to another? Where is the information about blocks stored in the database?
Is it possible to copy all the existing block placement information from one theme to another? Where is the information about blocks stored in the database?
Comments
The info is stored in the
The info is stored in the blocks and boxes table I believe. I'm not at an installation right now, so I cannot definitely say. But, you should be able do a SQL statement to copy from one theme to another theme.
- Shane
SQL statement to move blocks setting from one theme to another
In order to move all the blocks assigned to a theme to another theme I did the following SQL statements:
>mysql -u -p -h
>use
>select distinct theme from blocks;
get your "current-theme" name and the "old-theme" from which you want to copy the block settings
>delete from blocks where theme = '';
>update blocks set theme = '' where theme = '';
>commit;
NOTE: it's better if you do a backup of your database before doing this
Hope can help :-)
Copy block settings to new theme
The instructions listed by filipiff will work to move block information form one theme to another. If you'd like to duplicate a theme and you want to copy all the block information into the new theme you could use the following SQL (as always, make a backup of your database before attempting) :
First, clear the existing block information for the new theme:
DELETE FROM blocks WHERE theme = 'NEW_THEME_NAME'Now, copy all the block information from the old theme:
INSERT INTO blocks (module, delta, theme, status, weight, region, custom, throttle, visibility, pages, title, cache) (SELECT module, delta, 'NEW_THEME_NAME', status, weight, region, custom, throttle, visibility, pages, title, cache FROM blocks WHERE theme = 'OLD_THEME_NAME')Note that this was for Drupal 6, so may need to be modified for other versions.
Copy block settings to new theme
I used the Block Region module on Drupal 6.19.
http://drupal.org/project/blockregion
I could move Zen block configurations to Adaptative Theme...
With this module, you get two checkbox that operate blocks migrations while saving....