블로그

PHP 유지보수

[마젠토2] 다른 웹호스팅 또는 SSL 로 마이그레이션 하는 가장 심플한 방법

안녕하세요 ?
국내 유일의 PHP 쇼핑몰 교육 모임인 “Dabory PET(Dabory PHP E-Commerce Technology”에서 연구한 자료를 관심있는 여러분들과 공유하고 있습니다.
Magento-2 : Easiest wat to migrate to the other webhosting or change to SSL website in https

예)single.daboryhost.com에서 fit-vac.com 도메인 명의 웹사이트로 이전하기
선택 설명
(1)Magento
사이트 백업 및 복원
DB와 폴더를 snap-move-site 로 그대로 부어 준다. 이경우는  Kloxo Webhosting 을 사용할 경우이므로 일반 웹호스팅의 경우
public_html 전체과  DB를 백업하여 이전할  웹호스팅에 복원한다.
git 으로 하지 말것 vendor를 빼기 때문에 전체가 엉망이 되어 설치 불가능한 상태가 된다.
(2)Base URL 수정 phpmyadmin  로 진입하여 아래의 쿼리를 실행한다.

UPDATE core_config_data  SET value = ‘http://fit-vac.com/’
WHERE path IN (‘web/secure/base_url’, ‘web/unsecure/base_url’);
이것은 =>Store-Configuration-General-Web-BaseURLs-BaseURL, BaseURS(Secure)을 수정하는 것과 동일하다.

(3)Include URL 수정 phpmyadmin  에서 아래의 쿼리를 실행한다.

UPDATE core_config_data SET value = REPLACE(value, ‘single.daboryhost.com’, ‘fit-vac.com’)
WHERE path = ‘design/head/includes’;
이것은 =>=>Contents-Design-Configuration-website store-html head- Scripts and Style Sheets을
수정하는 것과 동일하다.

(4)domain folder 일치 domain folder 일치시킴.
(Kloxo의 경우 웹호스팅 root folder 에서 ln -s fitvac public_html 로 domain folder를 수정한다.
(5)app/etc/env.php 수정 backend 주소와 db 접속 정보 를 이전된 DB 연결 환경과 일치시킨다.
(6)domain folder 일치 domain folder 일치시킴.
(7)my-kloxo-cleanup 서버를 못찾아서 서있으면 엔터를 몇번 쳐줄 것. kloxo 웹호스팅의 경우
https:// 링크 문제가 발생할시의 수정 방법
미리 ssl 적용하면 관리자 모드로 들어갈 수 없기 때문에 phpmysql 에서 직접 Query를 실행하면 빨리 적용할 수 있다.
위 항목의 (2)(3)에서  http -> https 로 바꾸어서 쿼리 실행을 한다.

Leave a Reply

Your email address will not be published. Required fields are marked *