{"id":209,"date":"2018-01-21T20:22:09","date_gmt":"2018-01-21T12:22:09","guid":{"rendered":"http:\/\/davidblus.top\/wordpress\/?p=209"},"modified":"2018-09-22T14:51:40","modified_gmt":"2018-09-22T06:51:40","slug":"wordpress_geng_huan_yu_ming","status":"publish","type":"post","link":"http:\/\/davidblus.top\/wordpress\/index.php\/2018\/01\/21\/wordpress_geng_huan_yu_ming\/","title":{"rendered":"wordpress\u66f4\u6362\u57df\u540d"},"content":{"rendered":"<p>\u7531\u4e8e\u6211\u7684WordPress\u662f\u642d\u5728\u4e9a\u9a6c\u900a\u7684AWS\u4e0a\u7684\uff0c\u514d\u8d39\u4f53\u9a8c12\u4e2a\u6708\u7684\u7248\u672c\uff0c\u7cfb\u7edf\u505c\u6b62\u540e\u542f\u52a8\u4f1a\u66f4\u6539\u5176\u516c\u6709DNS\uff0c\u5c3d\u7ba1\u6211\u5c3d\u91cf\u4e0d\u53bb\u505c\u6b62\u8fd9\u4e2a\u5df2\u542f\u52a8\u7684\u5b9e\u4f8b\uff0c\u4f46\u662f\u6709\u65f6\u5019\u5374\u4e0d\u5f97\u4e0d\u505c\u6b62\u8be5\u5b9e\u4f8b\uff0c\u56e0\u6b64\u5c31\u51fa\u73b0\u4e86WordPress\u4e2d\u57df\u540d\u53d8\u5316\u7684\u95ee\u9898\uff0c\u5bfc\u81f4\u65e0\u6cd5\u4f7f\u7528WordPress\uff0c\u901a\u8fc7\u7f51\u4e0a\u67e5\u8be2\u4e5f\u67e5\u5230\u4e86\u4e3b\u6d41\u7684\u89e3\u51b3\u529e\u6cd5\uff0c\u6839\u636e\u6211\u5f53\u524d\u7684\u9700\u6c42\u53c8\u6dfb\u52a0\u4e86\u4e00\u4e9b\u989d\u5916\u7684\u4fee\u6539\uff0c\u6700\u540e\u6211\u5199\u6210\u4e86\u4e00\u4e2ashell\u811a\u672c\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"bash\"><br \/>if [ \"$#\" -eq \"2\" ];then\n    echo \"My old domain is $1\"\n    echo \"My new domain is $2\"\nelse\n    echo \"Usage: `basename $0` old.com new.com\"\n    echo \"You provided $# parameters,but 2 are required.\"\n    exit\nfi\n\nold_domain=$1\nnew_domain=$2\n\nmysql -u\u7528\u6237\u540d -p\u5bc6\u7801 wordpress_blog &lt;&lt;EOF\nUPDATE wp_options SET option_value = replace( option_value, '${old_domain}', '${new_domain}' ) WHERE option_name = 'home' OR option_name = 'siteurl';\nUPDATE wp_posts SET post_content = replace( post_content, '${old_domain}', '${new_domain}' ) ;\nUPDATE wp_posts SET guid = replace( guid, '${old_domain}', '${new_domain}' ) ;\nUPDATE wp_postmeta SET meta_value = replace( meta_value, '${old_domain}', '${new_domain}' ) WHERE meta_key = '_menu_item_url';\nEOF\n\n<\/code><\/pre>\n<p>\u6ce8\u610f\uff1a\u4ee3\u7801\u4e2d\u7528\u6237\u540d\u548c\u5bc6\u7801\u9700\u8981\u4fee\u6539\u4e3a\u81ea\u5df1\u7684MySQL\u7528\u6237\u540d\u548c\u5bc6\u7801\u3002<br \/>\n\u4e0a\u8ff0\u4ee3\u7801\u4fdd\u5b58\u4e3a\u540e\u7f00\u540d\u4e3a.sh\u6587\u4ef6\uff0c\u6dfb\u52a0\u8be5\u6587\u4ef6\u53ef\u6267\u884c\u6743\u9650\uff0c\u6309\u7167\u63d0\u793a\u6267\u884c\u8be5\u811a\u672c\u5373\u53ef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7531\u4e8e\u6211\u7684WordPress\u662f\u642d\u5728\u4e9a\u9a6c\u900a\u7684AWS\u4e0a\u7684\uff0c\u514d\u8d39\u4f53\u9a8c12\u4e2a\u6708\u7684\u7248\u672c\uff0c\u7cfb\u7edf\u505c\u6b62\u540e\u542f\u52a8\u4f1a\u66f4\u6539\u5176\u516c\u6709DNS\uff0c &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/davidblus.top\/wordpress\/index.php\/2018\/01\/21\/wordpress_geng_huan_yu_ming\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201cwordpress\u66f4\u6362\u57df\u540d\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-209","post","type-post","status-publish","format-standard","hentry","category-wordpress","entry"],"_links":{"self":[{"href":"http:\/\/davidblus.top\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/davidblus.top\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/davidblus.top\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/davidblus.top\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/davidblus.top\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=209"}],"version-history":[{"count":9,"href":"http:\/\/davidblus.top\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/209\/revisions"}],"predecessor-version":[{"id":478,"href":"http:\/\/davidblus.top\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/209\/revisions\/478"}],"wp:attachment":[{"href":"http:\/\/davidblus.top\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/davidblus.top\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=209"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/davidblus.top\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}