protected function _copyToHistory($sId, $iShopId, $iLang, $sType = null, $sNewId = null)
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sObjectid = $sNewId ? $oDb->quote($sNewId) : 'oxobjectid';
        $sType = $sType ? "oxtype =" . $oDb->quote($sType) . " and" : '';
        $iLang = (int) $iLang;

        // moving
        $sSub = "select $sObjectid, MD5( LOWER( oxseourl ) ), oxshopid, oxlang, now() from oxseo
                 where {$sType} oxobjectid = " . $oDb->quote($sId) . " and oxshopid = " . $oDb->quote($iShopId) . " and
                 oxlang = {$iLang} and oxexpired = '1'";
        $sQ = "replace oxseohistory ( oxobjectid, oxident, oxshopid, oxlang, oxinsert ) {$sSub}";
        $oDb->execute($sQ);
    }