eccube2.4→2.11へ
2.4バージョンから2.11へのデータ移行についてのメモ
本来エクスポートモジュール&インポートモジュールを利用してのデータ移行が好ましいのだが、
データ量、共用サーバーの都合もあり手動にて行う事に。
とりあえず必要となる顧客データ及び売上データを移行する。
----------------------------------------------------------
基本的には、[dtb_customer]、[dtb_other_deliv]のデータをそのままインポート。
旧バージョンの'data/cacha/mtb_constants.php'の
/** 認証用 magic */
define('AUTH_MAGIC', "**************************");
ってところの値を2.11.0の'data/config/config.php'のAUTH_MAGIC値に上書き。
2.11の'data/class/util/SC_Utils.php'
function sfIsMatchHashPassword($pass, $hashpass, $salt) {
$res = false;
if ($hashpass != '') {
if (AUTH_TYPE == 'PLAIN') {
if($pass === $hashpass) {
$res = true;
}
} else {
$hash = SC_Utils_Ex::sfGetHashString($pass, $salt);
if($hash === $hashpass) {
$res = true;
}
}
}
return $res;
}
を
function sfIsMatchHashPassword($pass, $hashpass, $salt) {
$res = false;
if ($hashpass != '') {
if (AUTH_TYPE == 'PLAIN') {
if($pass === $hashpass) {
$res = true;
}
} else {
if (empty($salt)) {
// 旧バージョンからの移行を考慮
$hash = sha1($pass . ":" . AUTH_MAGIC);
} else {
$hash = SC_Utils_Ex::sfGetHashString($pass, $salt);
}
if($hash === $hashpass) {
$res = true;
}
}
}
return $res;
}
に変更。(2.11.1では、変更済みっぽい。)
----------------------------------------------------------
これだけだと、新規会員登録が出来ないので
dtb_customerテーブルに2.11系で必須のsalt列を追加する。
これで新規会員登録が出来るようになった。
本来エクスポートモジュール&インポートモジュールを利用してのデータ移行が好ましいのだが、
データ量、共用サーバーの都合もあり手動にて行う事に。
とりあえず必要となる顧客データ及び売上データを移行する。
----------------------------------------------------------
基本的には、[dtb_customer]、[dtb_other_deliv]のデータをそのままインポート。
旧バージョンの'data/cacha/mtb_constants.php'の
/** 認証用 magic */
define('AUTH_MAGIC', "**************************");
ってところの値を2.11.0の'data/config/config.php'のAUTH_MAGIC値に上書き。
2.11の'data/class/util/SC_Utils.php'
function sfIsMatchHashPassword($pass, $hashpass, $salt) {
$res = false;
if ($hashpass != '') {
if (AUTH_TYPE == 'PLAIN') {
if($pass === $hashpass) {
$res = true;
}
} else {
$hash = SC_Utils_Ex::sfGetHashString($pass, $salt);
if($hash === $hashpass) {
$res = true;
}
}
}
return $res;
}
を
function sfIsMatchHashPassword($pass, $hashpass, $salt) {
$res = false;
if ($hashpass != '') {
if (AUTH_TYPE == 'PLAIN') {
if($pass === $hashpass) {
$res = true;
}
} else {
if (empty($salt)) {
// 旧バージョンからの移行を考慮
$hash = sha1($pass . ":" . AUTH_MAGIC);
} else {
$hash = SC_Utils_Ex::sfGetHashString($pass, $salt);
}
if($hash === $hashpass) {
$res = true;
}
}
}
return $res;
}
に変更。(2.11.1では、変更済みっぽい。)
----------------------------------------------------------
これだけだと、新規会員登録が出来ないので
dtb_customerテーブルに2.11系で必須のsalt列を追加する。
これで新規会員登録が出来るようになった。

