その他 > その他 > 2.0.1a から 2.3.3 へのDBアップグレードスクリプト |
その他
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | 下へ |
投稿者 | スレッド |
---|---|
surf |
投稿日時: 2008/12/11 14:28
対応状況: −−−
|
新米 登録日: 2008/12/11 居住地: 投稿: 1 |
2.0.1a から 2.3.3 へのDBアップグレードスクリプト 必要に迫られ、2.0.1a から 2.3.3 へのDBアップグレードスクリプトを作成致しました。
単純に2.0.1aと2.3.3のDB作成スクリプトの差分です。 (必要なさそうな部分はカットしてます) たいしたものではありませんが、必要な方はどうぞ。 アップグレード方法 1.新サーバで普通に2.3.3を導入します その後、元DBを適用するためにDBを削除します dropdb dbname 2.DBを旧サーバでダンプし、新サーバへリストアします 旧サーバ側 pg_dump dbname <option> > dbname.pgdmp 新サーバ側 createdb dbname <option> psql -d dbname -U dbuser -f ./dbname.pgdmp <option> or pg_restore 3.貼り付けてあるスクリプトを実行します psql -d dbname -U dbuser -f ./script.sql 4.デザインテンプレートなどは、再度登録し直して下さい。 script.sql - ここから utf-8で ****************************** CREATE TABLE dtb_holiday ( holiday_id serial NOT NULL, title text NOT NULL, month int2 NOT NULL, day int2 NOT NULL, rank int4 NOT NULL DEFAULT 0, creator_id int4 NOT NULL, create_date timestamp NOT NULL DEFAULT now(), update_date timestamp NOT NULL, del_flg int2 NOT NULL DEFAULT 0 ); INSERT INTO dtb_bloc ( bloc_name, tpl_path, filename, php_path, del_flg, create_date, update_date ) VALUES ('カレンダー', 'bloc/calendar.tpl', 'calendar', 'frontparts/bloc/calendar.php', 1, now(), now()); insert into dtb_csv(csv_id,col,disp_name,rank,status)values(5,'category_id','カテゴリID',1,2); insert into dtb_csv(csv_id,col,disp_name,rank,status)values(5,'category_name','カテゴリ名',2,2); insert into dtb_csv(csv_id,col,disp_name,rank,status)values(5,'parent_category_id','親カテゴリID',3,2); insert into dtb_csv(csv_id,col,disp_name,status)values(5,'level','階層',2); insert into dtb_csv(csv_id,col,disp_name,status)values(5,'rank','表示ランク',2); update dtb_product_categories set rank = 4 where product_id = 2 and category_id = 4; INSERT INTO dtb_holiday (title, month, day, rank, creator_id, update_date, del_flg, create_date) VALUES ('元旦(1月1日)','1', '1' ,100, 0, now(), 0, now()); INSERT INTO dtb_holiday (title, month, day, rank, creator_id, update_date, del_flg, create_date) VALUES ('成人の日(1月第2月曜日)','1', '14' ,98, 0, now(), 0, now()); INSERT INTO dtb_holiday (title, month, day, rank, creator_id, update_date, del_flg, create_date) VALUES ('建国記念の日(2月11日)','2', '11' ,96, 0, now(), 0, now()); INSERT INTO dtb_holiday (title, month, day, rank, creator_id, update_date, del_flg, create_date) VALUES ('春分の日(3月21日)','3', '21' ,94, 0, now(), 0, now()); INSERT INTO dtb_holiday (title, month, day, rank, creator_id, update_date, del_flg, create_date) VALUES ('昭和の日(4月29日)','4', '29' ,92, 0, now(), 0, now()); INSERT INTO dtb_holiday (title, month, day, rank, creator_id, update_date, del_flg, create_date) VALUES ('憲法記念日(5月3日)','5', '3' ,90, 0, now(), 0, now()); INSERT INTO dtb_holiday (title, month, day, rank, creator_id, update_date, del_flg, create_date) VALUES ('みどりの日(5月4日)','5', '4' ,88, 0, now(), 0, now()); INSERT INTO dtb_holiday (title, month, day, rank, creator_id, update_date, del_flg, create_date) VALUES ('こどもの日(5月5日)','5', '5' ,86, 0, now(), 0, now()); INSERT INTO dtb_holiday (title, month, day, rank, creator_id, update_date, del_flg, create_date) VALUES ('海の日(7月第3月曜日)','7', '21' ,84, 0, now(), 0, now()); INSERT INTO dtb_holiday (title, month, day, rank, creator_id, update_date, del_flg, create_date) VALUES ('敬老の日(9月第3月曜日)','9', '15' ,82, 0, now(), 0, now()); INSERT INTO dtb_holiday (title, month, day, rank, creator_id, update_date, del_flg, create_date) VALUES ('秋分の日(9月23日)','9', '23' ,80, 0, now(), 0, now()); INSERT INTO dtb_holiday (title, month, day, rank, creator_id, update_date, del_flg, create_date) VALUES ('体育の日(10月第2月曜日)','10', '13' ,78, 0, now(), 0, now()); INSERT INTO dtb_holiday (title, month, day, rank, creator_id, update_date, del_flg, create_date) VALUES ('文化の日(11月3日)','11', '3' ,76, 0, now(), 0, now()); INSERT INTO dtb_holiday (title, month, day, rank, creator_id, update_date, del_flg, create_date) VALUES ('勤労感謝の日(11月23日)','11', '23' ,74, 0, now(), 0, now()); INSERT INTO dtb_holiday (title, month, day, rank, creator_id, update_date, del_flg, create_date) VALUES ('天皇誕生日(12月23日)','12', '23' ,72, 0, now(), 0, now()); update mtb_mail_tpl_path set name = 'mobile/mail_templates/order_mail.tpl' where id = '2'; update mtb_delivery_date set name = '1日から2日後' where id = '2'; update mtb_delivery_date set name = '3日から4日後' where id = '3'; update mtb_constants set name = '""' where id = 'DB_ERROR_MAIL_TO'; update mtb_constants set rank = 16 where id = 'USER_TEMPLATE_DIR'; delete from mtb_constants where id = 'EBIS_TAG_MID'; delete from mtb_constants where id = 'AFF_TAG_MID'; delete from mtb_constants where id = 'CREDIT_HTTP_DOMAIN'; delete from mtb_constants where id = 'CREDIT_HTTP_ANALYZE_PROGRAM'; delete from mtb_constants where id = 'CREDIT_HTTP_ANALYZE_URL'; INSERT INTO mtb_constants VALUES ('LOCALE','"ja_JP.UTF-8"',40,'ロケール設定'); INSERT INTO mtb_constants VALUES ('PEAR_DB_PERSISTENT','false',43,'PEAR::DBの持続的接続オプション(false:OFF、true:ON)'); update mtb_constants set rank = 44 where id = 'LOAD_BATCH_PASS'; update mtb_constants set rank = 45 where id = 'CLOSE_DAY'; update mtb_constants set rank = 46 where id = 'FAVORITE_ERROR'; update mtb_constants set rank = 47 where id = 'LIB_DIR'; update mtb_constants set rank = 48 where id = 'TTF_DIR'; update mtb_constants set rank = 49 where id = 'GRAPH_DIR'; update mtb_constants set rank = 50 where id = 'GRAPH_URL'; update mtb_constants set rank = 51 where id = 'GRAPH_PIE_MAX'; update mtb_constants set rank = 52 where id = 'GRAPH_LABEL_MAX'; update mtb_constants set rank = 53 where id = 'PDF_DIR'; update mtb_constants set rank = 54 where id = 'BAT_ORDER_AGE'; update mtb_constants set rank = 55 where id = 'PRODUCTS_TOTAL_MAX'; update mtb_constants set rank = 56 where id = 'DEFAULT_PRODUCT_DISP'; update mtb_constants set rank = 57 where id = 'DELIV_FREE_AMOUNT'; update mtb_constants set rank = 58 where id = 'INPUT_DELIV_FEE'; update mtb_constants set rank = 59 where id = 'OPTION_PRODUCT_DELIV_FEE'; update mtb_constants set rank = 60 where id = 'OPTION_DELIV_FEE'; update mtb_constants set rank = 61 where id = 'OPTION_RECOMMEND'; update mtb_constants set rank = 62 where id = 'OPTION_CLASS_REGIST'; update mtb_constants set rank = 63 where id = 'TV_IMAGE_WIDTH'; update mtb_constants set rank = 64 where id = 'TV_IMAGE_HEIGHT'; update mtb_constants set rank = 65 where id = 'TV_PRODUCTS_MAX'; update mtb_constants set rank = 66 where id = 'DEFAULT_PASSWORD'; delete from mtb_constants where id = 'dtbDUCT_MAX'; update mtb_constants set name = 'false' where id = 'DEBUG_MODE'; update mtb_constants set name = 'false' where id = 'CUSTOMER_CONFIRM_MAIL'; update mtb_constants set name = 'true' where id = 'MELMAGA_SEND'; update mtb_constants set name = 'false' where id = 'MELMAGA_BATCH_MODE'; update mtb_constants set name = 'false' where id = 'DAILY_BATCH_MODE'; delete from mtb_constants where id = 'CGI_DIR'; delete from mtb_constants where id = 'CGI_FILE'; INSERT INTO mtb_constants VALUES ('RECOMMEND_PRODUCT_MAX','6',268,'関連商品表示数'); update mtb_constants set rank = 269 where id = 'RECOMMEND_NUM'; update mtb_constants set rank = 270 where id = 'BEST_MAX'; update mtb_constants set rank = 271 where id = 'BEST_MIN'; update mtb_constants set rank = 272 where id = 'DELIV_DATE_END_MAX'; update mtb_constants set rank = 273 where id = 'PURCHASE_CUSTOMER_REGIST'; update mtb_constants set rank = 274 where id = 'RELATED_PRODUCTS_MAX'; update mtb_constants set rank = 275 where id = 'CV_PAYMENT_LIMIT'; update mtb_constants set rank = 276 where id = 'CAMPAIGN_REGIST_MAX'; update mtb_constants set rank = 277 where id = 'REVIEW_ALLOW_URL'; update mtb_constants set rank = 278 where id = 'TRACKBACK_STATUS_VIEW'; update mtb_constants set rank = 279 where id = 'TRACKBACK_STATUS_NOT_VIEW'; update mtb_constants set rank = 280 where id = 'TRACKBACK_STATUS_SPAM'; update mtb_constants set rank = 281 where id = 'TRACKBACK_VIEW_MAX'; update mtb_constants set rank = 282 where id = 'TRACKBACK_TO_URL'; update mtb_constants set rank = 283 where id = 'SITE_CONTROL_TRACKBACK'; update mtb_constants set rank = 284 where id = 'SITE_CONTROL_AFFILIATE'; update mtb_constants set rank = 285 where id = 'MAIL_BACKEND'; update mtb_constants set rank = 286 where id = 'OS_TYPE'; update mtb_constants set rank = 287 where id = 'SMTP_HOST'; update mtb_constants set rank = 288 where id = 'SMTP_PORT'; update mtb_constants set name = '"default"' where id = 'TEMPLATE_NAME'; update mtb_constants set rank = 303 where id = 'TEMPLATE_DIR'; update mtb_constants set name = 'SMARTY_TEMPLATES_DIR . DEFAULT_TEMPLATE_NAME . "/admin/"', rank = 304 where id = 'TEMPLATE_ADMIN_DIR'; update mtb_constants set rank = 305 where id = 'COMPILE_DIR'; update mtb_constants set rank = 306 where id = 'COMPILE_ADMIN_DIR'; update mtb_constants set rank = 307 where id = 'TEMPLATE_FTP_DIR'; update mtb_constants set rank = 308 where id = 'COMPILE_FTP_DIR'; update mtb_constants set rank = 309 where id = 'BLOC_DIR'; update mtb_constants set rank = 310 where id = 'BLOC_PATH'; update mtb_constants set rank = 311 where id = 'CAMPAIGN_DIR'; update mtb_constants set rank = 312 where id = 'CAMPAIGN_URL'; update mtb_constants set rank = 313 where id = 'CAMPAIGN_PATH'; update mtb_constants set rank = 314 where id = 'CAMPAIGN_TEMPLATE_DIR'; update mtb_constants set rank = 315 where id = 'CAMPAIGN_TEMPLATE_PATH'; update mtb_constants set rank = 316 where id = 'CAMPAIGN_BLOC_DIR'; update mtb_constants set rank = 317 where id = 'CAMPAIGN_BLOC_PATH'; update mtb_constants set rank = 318 where id = 'CAMPAIGN_TEMPLATE_ACTIVE'; update mtb_constants set rank = 319 where id = 'CAMPAIGN_TEMPLATE_END'; update mtb_constants set remarks = 'モバイルサイトのセッションの存続時間 (秒)' where id = 'MOBILE_SESSION_LIFETIME'; update mtb_constants set remarks = '空メール機能を使用するかどうか(true:送信する、false:送信しない)' where id = 'MOBILE_USE_KARA_MAIL'; INSERT INTO mtb_constants VALUES ('SESSION_KEEP_METHOD', '"useCookie"', 418,'セッション維持方法:useCookie|useRequest'); INSERT INTO mtb_constants VALUES ('SESSION_LIFETIME', '"1800"', 419,'セッションの存続時間 (秒)'); ****************************** |
shinshinsh |
投稿日時: 2008/12/19 21:54
対応状況: −−−
|
半人前 登録日: 2008/7/18 居住地: 投稿: 12 |
Re: 2.0.1a から 2.3.3 へのDBアップグレードスクリプト お疲れ様です!
参考にさせて頂きます。 つかぬ事をお伺いしますが、2.1.2からのアップデートも同じスクリプトで問題ありませんでしょうか? |
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | トップ |