{"id":3302,"date":"2017-05-27T22:18:53","date_gmt":"2017-05-27T14:18:53","guid":{"rendered":"https:\/\/ixyzero.com\/blog\/?p=3302"},"modified":"2017-05-27T22:18:53","modified_gmt":"2017-05-27T14:18:53","slug":"wordpress%e7%bd%91%e7%ab%99%e6%9b%b4%e6%8d%a2%e5%9f%9f%e5%90%8d%e7%9a%84%e5%87%a0%e4%b8%aa%e6%ad%a5%e9%aa%a4","status":"publish","type":"post","link":"https:\/\/ixyzero.com\/blog\/archives\/3302.html","title":{"rendered":"WordPress\u7f51\u7ad9\u66f4\u6362\u57df\u540d\u7684\u51e0\u4e2a\u6b65\u9aa4"},"content":{"rendered":"<p>=Start=<\/p>\n<h4>\u7f18\u7531\uff1a<\/h4>\n<p>\u4e4b\u524d\u4e70\u7684\u4e00\u4e2a\u57df\u540d\u5feb\u5230\u671f\u4e86\uff08\u867d\u7136\u6709\u5f88\u591a\u4e0d\u820d\uff0c\u4f46\u662f.me\u57df\u540d\u7684\u7eed\u671f\u8d39\u7528\u771f\u7684\u597d\u8d35\uff01\uff01\uff01\uff09\uff0c\u5c31\u60f3\u7740\u6362\u4e00\u4e2a\u770b\u4e0a\u53bb\u4f1a\u6b63\u5e38\u4e00\u70b9\u7684.com\u57df\u540d\uff0c\u4e00\u6b21\u6027\u591a\u5f04\u4e2a\u51e0\u5e74\uff0c\u7701\u5f97\u540e\u671f\u56e0\u4e3a\u4e2a\u7eed\u8d39\u7684\u95ee\u9898\u7ea0\u7ed3\uff0c\u4e5f\u5c3d\u91cf\u907f\u514d\u7531\u4e8e\u6362\u57df\u540d\u5bfc\u81f4\u7684\u5404\u79cd\u95ee\u9898\u3002<\/p>\n<p>\u8fd9\u91cc\u5c31\u8bb0\u5f55\u4e00\u4e0bWordPress\u7f51\u7ad9\u66f4\u6362\u57df\u540d\u7684\u51e0\u4e2a\u6b65\u9aa4\uff0c\u65b9\u4fbf\u4ee5\u540e\u53c2\u8003\u3002<\/p>\n<h4>\u6b63\u6587\uff1a<\/h4>\n<h5>\u53c2\u8003\u89e3\u7b54\uff1a<\/h5>\n<h6>\u6362\u7a7a\u95f4 + \u6362\u57df\u540d<\/h6>\n<ol>\n<li>\u5f00\u59cb\u4e4b\u524d\uff0c\u8bf7\u5148\u505a\u597d\u7f51\u7ad9\u7684\u5907\u4efd\uff0c\u5907\u4efd\u597d<span style=\"color: #ff0000;\"><strong>\u7f51\u7ad9\u6570\u636e\u5e93<\/strong><\/span>\u548c<span style=\"color: #ff0000;\"><strong>\u7f51\u7ad9\u6587\u4ef6<\/strong><\/span>\u3002\u5c24\u5176\u662f\u6570\u636e\u5e93\uff0c\u4e00\u5b9a\u8981\u505a\u597d\u5907\u4efd\uff0c\u4ee5\u9632\u64cd\u4f5c\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u9519\u8bef\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5907\u4efd\u7684\u6570\u636e\u5e93\u91cd\u65b0\u8fdb\u884c\u64cd\u4f5c\u3002\u7136\u540e<span style=\"color: #0000ff;\">\u6ce8\u610f\u66f4\u65b0 wp-config.php \u6587\u4ef6<\/span>\u4e2d\u7684\u914d\u7f6e\u3002<\/li>\n<li>\u5c06\u65b0\u57df\u540d\u505a\u597d\u89e3\u6790\u548c\u7ed1\u5b9a\u64cd\u4f5c\u3002\u53ef\u53c2\u8003\u300c<a href=\"https:\/\/support.dnspod.cn\/Kb\/showarticle\/tsid\/28\/\">DNSPod\u7684\u89e3\u6790\uff08\u65e0\u7f1d\u8fc1\u79fb\uff09<\/a>\u300d\u548c\u300c<a href=\"https:\/\/support.dnspod.cn\/Kb\/showarticle\/tsid\/42\/\">Godaddy\u6ce8\u518c\u5546\u57df\u540d\u4fee\u6539DNS\u5730\u5740<\/a>\u300d<\/li>\n<li>\u66f4\u65b0\u6570\u636e\u5e93\u4e2d\u7684\u57df\u540d\u3002\u5177\u4f53\u53c2\u8003\uff1a\u300c<a href=\"https:\/\/www.liaosam.com\/how-wordpress-changes-domain.html\">WordPress\u66f4\u6362\u57df\u540d\u8be6\u7ec6\u653b\u7565<\/a>\u300d\n<pre class=\"lang:default decode:true\">UPDATE wp_prefix_options SET option_value = replace(option_value, 'old-domain.me', 'ixyzero.com') WHERE option_name = 'home' OR option_name = 'siteurl' ;\r\nUPDATE wp_prefix_posts SET post_content = replace(post_content, 'old-domain.me', 'ixyzero.com') ;\r\nUPDATE wp_prefix_posts SET guid = replace(guid, 'old-domain.me', 'ixyzero.com') ;\r\nUPDATE wp_prefix_comments SET comment_content = replace(comment_content, 'old-domain.me', 'ixyzero.com') ;\r\nUPDATE wp_prefix_comments SET comment_author_url = replace(comment_author_url, 'old-domain.me', 'ixyzero.com') ;<\/pre>\n<\/li>\n<li>\u5168\u7ad9301\u91cd\u5b9a\u5411\u3002<\/li>\n<\/ol>\n<h6>\u6362\u57df\u540d<\/h6>\n<ol>\n<li>\u5f00\u59cb\u4e4b\u524d\uff0c\u8bf7\u5148\u505a\u597d\u7f51\u7ad9\u7684\u5907\u4efd\uff0c\u5907\u4efd\u597d\u7f51\u7ad9\u6570\u636e\u5e93\u548c\u7f51\u7ad9\u6587\u4ef6\u3002\u5c24\u5176\u662f\u6570\u636e\u5e93\uff0c\u4e00\u5b9a\u8981\u505a\u597d\u5907\u4efd\uff0c\u4ee5\u9632\u64cd\u4f5c\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u9519\u8bef\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5907\u4efd\u7684\u6570\u636e\u5e93\u91cd\u65b0\u8fdb\u884c\u64cd\u4f5c\u3002<span style=\"color: #0000ff;\">tips\uff1a\u53ef\u4ee5\u5728\u540c\u4e00\u4e2a\u6570\u636e\u5e93\u5b9e\u4f8b\u4e2d\u53e6\u5916\u65b0\u5efa\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u7136\u540e\u5c06\u539fWordPress\u535a\u5ba2\u7684\u6570\u636e\u5e93\u8868clone\u8fc7\u53bb<\/span>\uff0c\u53ef\u53c2\u8003\uff1a\u300c<strong><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.6\/en\/mysqldump-copying-database.html\">MySQL\u4e2d\u5982\u4f55\u590d\u5236\u6570\u636e\u5e93<\/a><\/strong>\u300d\u3001\u300c<a href=\"http:\/\/stackoverflow.com\/questions\/2466101\/how-i-can-change-prefixes-in-all-tables-in-my-mysql-db\"><strong>MySQL\u4e2d\u5982\u4f55\u6279\u91cf\u4fee\u6539\u4e00\u4e2a\u6570\u636e\u5e93\u4e2d\u7684\u8868\u524d\u7f00<\/strong><\/a>\u300d<\/li>\n<li>\u5c06\u65b0\u57df\u540d\u505a\u597d\u89e3\u6790\u548c\u7ed1\u5b9a\u64cd\u4f5c\u3002\u53ef\u53c2\u8003\uff1a<strong>\u5982\u4f55\u5728\u5355\u53f0VPS\u4e0a\u914d\u7f6e\u591a\u4e2a\u57df\u540d\uff1f<\/strong><br \/>\n<a href=\"http:\/\/stackoverflow.com\/questions\/11773544\/nginx-different-domains-on-same-ip\">http:\/\/stackoverflow.com\/questions\/11773544\/nginx-different-domains-on-same-ip<\/a><br \/>\n<a href=\"http:\/\/nginx.org\/en\/docs\/http\/server_names.html\">http:\/\/nginx.org\/en\/docs\/http\/server_names.html<\/a><br \/>\n<a href=\"http:\/\/nginx.org\/en\/docs\/http\/request_processing.html\">http:\/\/nginx.org\/en\/docs\/http\/request_processing.html<\/a><br \/>\n<a href=\"https:\/\/www.nginx.com\/resources\/wiki\/start\/topics\/examples\/server_blocks\/\">https:\/\/www.nginx.com\/resources\/wiki\/start\/topics\/examples\/server_blocks\/<\/a><\/li>\n<li>\u66f4\u65b0\u6570\u636e\u5e93\u4e2d\u7684\u57df\u540d\u3002\u5f53\u91cd\u65b0\u4fee\u6539\u4e86\u6570\u636e\u5e93\u7684\u8868\u524d\u7f00\u65f6\uff0c\u5728\u767b\u5f55\u540e\u53f0\u7684\u65f6\u5019\u53ef\u80fd\u4f1a\u51fa\u73b0\u300c<a href=\"http:\/\/ols-lightshadow.lofter.com\/post\/2fd1c8_145721e\">\u60a8\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u8bbf\u95ee\u8be5\u9875\u9762<\/a>\u300d\u7684\u60c5\u51b5\uff0c\u89e3\u51b3\u529e\u6cd5\u5982\u4e0b\uff1a\n<pre class=\"lang:default decode:true\">\u9996\u5148\u6253\u5f00 ?_options \u8868\uff0c\u4fee\u6539 option_name \u5b57\u6bb5\u503c\u6539\u4e3a ?_user_roles \u4fee\u6539\u4e3a\u4e0e\u4f60\u7684\u524d\u7f00\u76f8\u5bf9\u5e94\uff1b\r\n\u7136\u540e\u6253\u5f00 ?_usermeta \u8868\uff0c\u5c06 meta_key \u5b57\u6bb5\u503c\u4e2d\u539f\u6765\u4fee\u6539\u8fc7\u524d\u7f00\u7684\u66f4\u65b0\u4e3a\u73b0\u5728\u7684\u524d\u7f00\u5c31OK\u3002\r\n\r\n\u5047\u8bbe\u539f\u59cb\u524d\u7f00\u4e3a old_prefix_ \uff0c\u73b0\u5728\u7684\u524d\u7f00\u4e3a new_prefix_ \uff0c\u5219SQL\u8bed\u53e5\u5982\u4e0b\uff1a\r\n\r\nUPDATE new_prefix_options SET option_name = REPLACE(option_name, 'old_prefix_user_roles', 'new_prefix_user_roles');\r\nUPDATE new_prefix_usermeta SET meta_key = REPLACE(meta_key, 'old_prefix_', 'new_prefix_') where meta_key like 'old_prefix_%';<\/pre>\n<\/li>\n<li>\u5168\u7ad9301\u91cd\u5b9a\u5411\u3002<\/li>\n<\/ol>\n<h5>\u53c2\u8003\u94fe\u63a5\uff1a<\/h5>\n<ul>\n<li>wordpress\u66f4\u6362\u57df\u540d\u7684\u51e0\u4e2a\u6b65\u9aa4<br \/>\n<a href=\"http:\/\/www.2zzt.com\/jcandcj\/5883.html\">http:\/\/www.2zzt.com\/jcandcj\/5883.html<\/a><br \/>\n<a href=\"https:\/\/codex.wordpress.org\/Moving_WordPress\">https:\/\/codex.wordpress.org\/Moving_WordPress<\/a><\/li>\n<li>\u5982\u4f55\u5b8c\u7f8e\u66f4\u6362WordPress\u7f51\u7ad9\u7684\u57df\u540d<br \/>\n<a href=\"http:\/\/wpchina.org\/how-to-change-wordpress-domain-prefectly-1528\/\">http:\/\/wpchina.org\/how-to-change-wordpress-domain-prefectly-1528\/<\/a><\/li>\n<li>\u5982\u4f55\u624b\u52a8\u5907\u4efdWordPress\u6570\u636e\u5e93<br \/>\n<a href=\"http:\/\/wpchina.org\/how-to-backup-wordpress-database-manually-1437\/\">http:\/\/wpchina.org\/how-to-backup-wordpress-database-manually-1437\/<\/a><\/li>\n<li>WordPress\u535a\u5ba2\u7f51\u7ad9\u642c\u5bb6\u548c\u6362\u57df\u540d\u65b9\u6cd5<br \/>\n<a href=\"https:\/\/blog.fazero.me\/2015\/07\/11\/WordPress%E5%8D%9A%E5%AE%A2%E7%BD%91%E7%AB%99%E6%90%AC%E5%AE%B6%E5%92%8C%E6%8D%A2%E5%9F%9F%E5%90%8D%E6%96%B9%E6%B3%95\/\">https:\/\/blog.fazero.me\/2015\/07\/11\/WordPress%E5%8D%9A%E5%AE%A2%E7%BD%91%E7%AB%99%E6%90%AC%E5%AE%B6%E5%92%8C%E6%8D%A2%E5%9F%9F%E5%90%8D%E6%96%B9%E6%B3%95\/<\/a><\/li>\n<li>WordPress\u66f4\u6362\u57df\u540d\u8be6\u7ec6\u653b\u7565<br \/>\n<a href=\"https:\/\/www.liaosam.com\/how-wordpress-changes-domain.html\">https:\/\/www.liaosam.com\/how-wordpress-changes-domain.html<\/a><\/li>\n<\/ul>\n<p>=END=<\/p>\n","protected":false},"excerpt":{"rendered":"<p>=Start= \u7f18\u7531\uff1a \u4e4b\u524d\u4e70\u7684\u4e00\u4e2a\u57df\u540d\u5feb\u5230\u671f\u4e86\uff08\u867d\u7136\u6709\u5f88\u591a\u4e0d\u820d\uff0c\u4f46\u662f.me\u57df\u540d\u7684\u7eed\u671f\u8d39\u7528\u771f\u7684\u597d\u8d35\uff01\uff01\uff01\uff09\uff0c\u5c31 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,23,12],"tags":[16,75,99],"class_list":["post-3302","post","type-post","status-publish","format-standard","hentry","category-database","category-knowledgebase-2","category-tools","tag-mysql","tag-nginx","tag-wordpress"],"views":8476,"_links":{"self":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/3302","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/comments?post=3302"}],"version-history":[{"count":1,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/3302\/revisions"}],"predecessor-version":[{"id":3303,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/3302\/revisions\/3303"}],"wp:attachment":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/media?parent=3302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/categories?post=3302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/tags?post=3302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}