Snippet collection/clone theme with config 4-7 5-0

&lt;?php /** * for shop versions 4.7.x / 5.0.x * # copy the source-themefolders in application/views/tpl and /out and rename * # Adjust values for Source and Target below * # Put file into rootlevel * # run this script * # delete this file after usage */

// ADJUST THEME NAMES HERE ************************************************* $scriptConfig = (object) array(   'from' =&gt; 'azure',           // Source    'to'   =&gt; 'apsp'          // Target ); // *************************************************************************

ini_set('display_errors', 1);

if (!defined('OX_BASE_PATH')) { define('OX_BASE_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR ); }

// custom functions file require_once OX_BASE_PATH. 'modules/functions.php';

// Generic utility method file including autoloading definition require_once OX_BASE_PATH. 'core/oxfunctions.php';

//sets default PHP ini params setPhpIniParams;

//strips magics quote if any is set stripGpcMagicQuotes;

//init config.inc.php file reader $oConfigFile = new oxConfigFile( OX_BASE_PATH . "config.inc.php" );

oxRegistry::set("oxConfigFile", $oConfigFile );

$oDb     = oxDb::getDb(true); $oShopControl = oxNew('oxShopControl'); $shopConfig = $oShopControl-&gt;getConfig; $sShopId = $shopConfig-&gt;getBaseShopId;

$sSql = "   SELECT        `cfg`.`oxid`                                                   AS `id`,        `cfg`.`oxmodule`                                               AS `theme`,        `cfg`.`oxvarname`                                              AS `name`,        `cfg`.`oxvartype`                                              AS `type`,        DECODE( `cfg`.`oxvarvalue`, '" . $shopConfig-&gt;getConfigParam( 'sConfigKey' ) . "') AS `value`,        `cfgd`.`oxgrouping`                                            AS `group`,        `cfgd`.`oxvarconstraint`                                       AS `constraint`,        `cfgd`.`oxpos`                                                 AS `pos`    FROM        `oxconfig`        AS `cfg`,        `oxconfigdisplay` AS `cfgd`    WHERE        `cfg`.`oxshopid` = '". $sShopId. "'   AND        `cfg`.`oxmodule` = 'theme:". $scriptConfig-&gt;from ."'   AND(        `cfgd`.`oxcfgmodule` = `cfg`.`oxmodule`        AND        `cfgd`.`oxcfgvarname` = `cfg`.`oxvarname`    ) ";

$aThemeValues = $oDb-&gt;getAll( $sSql );

if( is_array( $aThemeValues )   &amp;&amp; !empty( $aThemeValues ) ) {   // delete existing values for theme $oDb-&gt;Execute("       DELETE FROM            `oxconfig`        WHERE            `oxshopid`  = '" . $sShopId . "'        AND            `oxmodule` = 'theme:" . $scriptConfig-&gt;to . "'    ");

// delete existing values for theme $oDb-&gt;Execute("       DELETE FROM            `oxconfigdisplay`        WHERE            `oxcfgmodule` = 'theme:" . $scriptConfig-&gt;to . "'    ");

foreach( $aThemeValues as $aConfig ) {       $cfg = $aConfig; $sSql = "           REPLACE INTO                `oxconfig`            SET                `OXID`       = '". $scriptConfig-&gt;to. "." . $cfg[2]. "',               `OXSHOPID`   = '". $sShopId. "',               `OXMODULE`   = 'theme:". $scriptConfig-&gt;to. "',               `OXVARNAME`  = '". $cfg[2]. "',               `OXVARTYPE`  = '". $cfg[3]. "',               `OXVARVALUE` = ENCODE( " . $oDb-&gt;quote( $cfg[4] ) . ", " . $oDb-&gt;quote( $shopConfig-&gt;getConfigParam( 'sConfigKey' ) ) . " )        "; $oDb-&gt;Execute($sSql); // display $sSql = "           REPLACE INTO                `oxconfigdisplay`            SET                `oxid`            = '". $scriptConfig-&gt;to. "." . $cfg[2]. "',               `oxcfgmodule`     = 'theme:". $scriptConfig-&gt;to. "',               `oxcfgvarname`    = '". $cfg[2]. "',               `oxgrouping`      = '". $cfg[5]. "',               `oxvarconstraint` = '". $cfg[6]. "',               `oxpos`           = '". $cfg[7]. "'     ";        $oDb-&gt;Execute($sSql); } } else { exit('Exception. No entries found for "'. $scriptConfig-&gt;from . '"' ); } Danke an pschoefer für die Bereitstellung des Scripts; Forenthread: http://forum.oxid-esales.com/showthread.php?t=17967