{"id":1607,"date":"2021-10-07T12:28:24","date_gmt":"2021-10-07T03:28:24","guid":{"rendered":"https:\/\/www.kwonline.org\/memo2\/?p=1607"},"modified":"2021-10-07T12:43:12","modified_gmt":"2021-10-07T03:43:12","slug":"migrate-wordpress-from-gce-to-azurevm","status":"publish","type":"post","link":"https:\/\/www.kwonline.org\/memo2\/2021\/10\/07\/migrate-wordpress-from-gce-to-azurevm\/","title":{"rendered":"WordPress \u306e\u30b5\u30fc\u30d0\u30fc\u3092\u5f15\u3063\u8d8a\u3057\u305f"},"content":{"rendered":"<p>&nbsp;<br \/>\nAzure \u306e\u52c9\u5f37\u306e\u305f\u3081\u306b GCP \u306e Compute Engine \u4e0a\u3067\u52d5\u304b\u3057\u3066\u305f WordPress \u3092 Azure VM \u306b\u5f15\u3063\u8d8a\u3057\u305f\u306e\u3067\u30e1\u30e2\u3002<br \/>\n\u3053\u306e\u6295\u7a3f\u3082\u5f15\u8d8a\u5148\u3067\u66f8\u3044\u305f\u3082\u306e\u3067\u3042\u308b\u3002<\/p>\n<p>\u30c9\u30e1\u30a4\u30f3\u306f\u5909\u308f\u3089\u305a\u3001 WordPress \u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d\u3068\u30e6\u30fc\u30b6\u30fc\u3082\u540c\u3058\u307e\u307e\u306a\u306e\u3067\u4f59\u8a08\u306a\u30c4\u30fc\u30eb\u306f\u4f7f\u308f\u306a\u3044\u65b9\u6cd5\u3067\u5bfe\u5fdc\u3002<\/p>\n<h2>\u5f15\u8d8a\u5143\u3067\u306e\u4f5c\u696d<\/h2>\n<p>\u307e\u305a\u306f Web \u30b5\u30a4\u30c8\u306e\u5185\u5bb9\u3092\u4e38\u3054\u3068\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3002<br \/>\n\u4ffa\u306f Git \u306b push \u3057\u3066\u5f15\u8d8a\u3057\u5148\u3067 pull \u3059\u308b\u3068\u3044\u3046\u96d1\u306a\u65b9\u6cd5\u3092\u63a1\u7528\u3002<\/p>\n<p>tar \u3067\u56fa\u3081\u3066\u5f15\u8d8a\u3057\u5148\u3067\u5c55\u958b\u3059\u308b\u65b9\u6cd5\u3067\u3082OK.<\/p>\n<p>\u305d\u308c\u304b\u3089 mysql \u306e\u4e2d\u8eab\u3092\u4e38\u3054\u3068 dump.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ mysqldump -u root -p wordpress &gt; backup.sql\r\n<\/pre>\n<h2>\u5f15\u8d8a\u5148\u3067\u306e\u4f5c\u696d<\/h2>\n<p>Azure VM \u3067 LAMP \u74b0\u5883\u306e\u69cb\u7bc9\u3092\u6e08\u307e\u3057\u3066\u304a\u304f\u3002<br \/>\n\u3042\u3068\u306f .htaccess \u3084\u3089 Apache conf \u306e AllowOverride \u8a2d\u5b9a\u3082\u5fd8\u308c\u305a\u306b\u3002<br \/>\n\u203b\u3053\u308c\u5fd8\u308c\u3066\u30d1\u30fc\u30de\u30ea\u30f3\u30af\u304c 404 \u306b\u306a\u3063\u305f\u3002<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;Directory \/var\/www\/mydomain\/&gt;\r\n    AllowOverride All\r\n&lt;\/Directory&gt;\r\n<\/pre>\n<p>\u305d\u3057\u3066 \/var\/www \u914d\u4e0b\u306b git \u30ea\u30dd\u30b8\u30c8\u30ea\u3092 clone.<br \/>\n\u305d\u3057\u305f\u3089 WordPress \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u6240\u6709\u8005\u3092 www-data \u306b\u623b\u3057\u3066\u304a\u304f\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ sudo chown -R www-data.www-data \/var\/www\/mydomain\r\n<\/pre>\n<p>\u7d9a\u3044\u3066\u5f15\u8d8a\u5143\u3067 dump \u3057\u305f backup.sql \u3092\u5f15\u8d8a\u5148\u306b\u6301\u3063\u3066\u6765\u3066\u30a4\u30f3\u30dd\u30fc\u30c8\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ mysql -u root -p wordpress &lt; backup.sql\r\n<\/pre>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u5909\u3048\u3061\u3083\u3063\u305f\u306e\u3067 wp-config.php \u3092\u7de8\u96c6\u3059\u308b\u3002<\/p>\n<p>\u3042\u3068\u306f DNS \u306e A \u30ec\u30b3\u30fc\u30c9\u5909\u3048\u305f\u306e\u3061\u3001 LetsEncrypt \u306e\u8a3c\u660e\u66f8\u3092\u53d6\u5f97\u3057\u76f4\u3059\u3002<\/p>\n<p>\u4ee5\u4e0a\u3001\u96d1\u306a\u5f15\u8d8a\u3057\u3002<br \/>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Azure \u306e\u52c9\u5f37\u306e\u305f\u3081\u306b GCP \u306e Compute Engine \u4e0a\u3067\u52d5\u304b\u3057\u3066\u305f WordPress \u3092 Azure VM \u306b\u5f15\u3063\u8d8a\u3057\u305f\u306e\u3067\u30e1\u30e2\u3002 \u3053\u306e\u6295\u7a3f\u3082\u5f15\u8d8a\u5148\u3067\u66f8\u3044\u305f\u3082\u306e\u3067\u3042\u308b\u3002 \u30c9\u30e1\u30a4\u30f3\u306f\u5909\u308f\u3089 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,19,8],"tags":[],"class_list":["post-1607","post","type-post","status-publish","format-standard","hentry","category-azure","category-gcp","category-linux"],"_links":{"self":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts\/1607","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/comments?post=1607"}],"version-history":[{"count":5,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts\/1607\/revisions"}],"predecessor-version":[{"id":1612,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts\/1607\/revisions\/1612"}],"wp:attachment":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/media?parent=1607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/categories?post=1607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/tags?post=1607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}