How to copy blocks placement and settings between themes? How can I copy blocks placement and settings between themes?

I've found this module: https://drupal.org/project/blockregion and this code to do it in the database. But both are for D6. How can I do this for D7

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')


Also found this, but for D5: http://pierrerebours.com/blog/duplicating-block-settings-across-themes-drupal
I changed a little bit the code and it worked:

Before running this code you should be sure that both themes have the same regions and, if needed you will have to create the missing regionsin the new theme.

DELETE FROM block WHERE theme = 'NEW-THEME'

INSERT INTO block (module, delta, theme, status, weight, region, custom, visibility, pages, title, cache, i18n_mode) (SELECT module, delta, 'NEW-THEME', status, weight, region, custom, visibility, pages, title, cache, i18n_mode FROM block WHERE theme = 'OLD-THEME')