{"id":683,"date":"2015-06-08T15:46:02","date_gmt":"2015-06-08T10:46:02","guid":{"rendered":"http:\/\/52.24.212.236\/?p=1"},"modified":"2016-09-01T21:40:49","modified_gmt":"2016-09-01T16:40:49","slug":"hello-world-2","status":"publish","type":"post","link":"http:\/\/www.stonemillkids.com\/index.php\/2015\/06\/08\/hello-world-2\/","title":{"rendered":"Site Crash &#8211; Testing Disaster Recovery!"},"content":{"rendered":"<p><strong>&#8220;Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!&#8221;<\/strong><\/p>\n<p>Well, not exactly.\u00a0 The system crashed &#8211; Well, not exactly, I messed up a setting in AWS. WordPress behaved properly, but user error brought down the site. Luckily, I had and xml backup of my content moments before.\u00a0 However, there are a couple of important lessons learned:<\/p>\n<p>1) The XML backup does not import images.\u00a0 I need to do that manually.\u00a0 It may\/may not happen on historical posts.\u00a0 Forgive me.<\/p>\n<p>2) Never hit the Terminate button in aws unless you know what you are doing.\u00a0 It took me 2 days to get back to where I am today.<\/p>\n<p>3a) Lesson learned &#8211; I was actually in the process of establishing the backup\/restore process when I setup something incorrect and the entire sight crashed.\u00a0 &#8211; Lesson learned &#8211; Do this earlier in the process.\u00a0 It look like a &#8220;image&#8221; can be saved from the right-click menu inside the EC2 dashboard.\u00a0 I would do that sooner than later.<\/p>\n<p>3b)\u00a0 The backup\/restore of wordpress does not include page layout and\/or themes, it only includes content.\u00a0 I have to redo the outwardly facing pages.<\/p>\n<p>&#8211;<\/p>\n<h3>Moving my Old Links<\/h3>\n<p>Because my IP address changed, and everything on the site is still based on IP, I had a hard time moving all of my references.\u00a0 There were really two ways of doing this (I found out)<\/p>\n<p>Easy Way &#8211; Search and replace the XML file prior to uploading it.<\/p>\n<p>Hard way &#8211; Use MySQL Commands:<\/p>\n<pre>mysql&gt; select option_name, option_value From wp_options WHERE option_name = 'siteurl'\r\n-&gt; ;\r\n+-------------+----------------------+\r\n| option_name | option_value\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\r\n+-------------+----------------------+\r\n| siteurl\u00a0\u00a0\u00a0\u00a0 | http:\/\/52.24.212.236 |\r\n+-------------+----------------------+\r\n1 row in set (0.00 sec)\r\n\r\nmysql&gt; UPDATE wp_options SET option_value ='http:\/\/52.24.147.87\/' WHERE option_name = 'siteurl';\r\nQuery OK, 1 row affected (0.00 sec)\r\nRows matched: 1\u00a0 Changed: 1\u00a0 Warnings: 0\r\n\r\nmysql&gt; select option_name, option_value From wp_options WHERE option_name = 'siteurl';\r\n+-------------+----------------------+\r\n| option_name | option_value\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\r\n+-------------+----------------------+\r\n| siteurl\u00a0\u00a0\u00a0\u00a0 | http:\/\/52.24.147.87\/ |\r\n+-------------+----------------------+\r\n1 row in set (0.00 sec)\r\n\r\nmysql&gt; select option_name, option_value From wp_options WHERE option_name = 'home';\r\n+-------------+----------------------+\r\n| option_name | option_value\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\r\n+-------------+----------------------+\r\n| home\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | http:\/\/52.24.212.236 |\r\n+-------------+----------------------+\r\n1 row in set (0.00 sec)\r\n\r\nmysql&gt; UPDATE wp_options SET option_value ='http:\/\/52.24.147.87\/' WHERE option_name = 'home';\r\nQuery OK, 1 row affected (0.01 sec)\r\nRows matched: 1\u00a0 Changed: 1\u00a0 Warnings: 0\r\n\r\nmysql&gt; select option_name, option_value From wp_options WHERE option_name = 'home';\r\n+-------------+----------------------+\r\n| option_name | option_value\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\r\n+-------------+----------------------+\r\n| home\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | http:\/\/52.24.147.87\/ |\r\n+-------------+----------------------+\r\n1 row in set (0.00 sec)\r\n\r\nmysql&gt; commit\r\n-&gt; ;\r\nQuery OK, 0 rows affected (0.00 sec)\r\n<\/pre>\n<p>Now it is time to replace the old links with the new ones.<\/p>\n<pre>mysql&gt; UPDATE wp_posts\r\nSET guid =\r\nREPLACE(\r\nguid,\r\n\"54.191.107.214\",\r\n\"52.24.147.87\"\r\n);\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!&#8221; Well, not exactly.\u00a0 The system crashed &#8211; Well, not exactly, I messed up a setting in AWS. WordPress behaved properly, but user error brought down the site. Luckily, I had and xml backup of my content moments before.\u00a0 However, there [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":739,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18,4,17],"tags":[25,24,29,30,26,32],"_links":{"self":[{"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/posts\/683"}],"collection":[{"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/comments?post=683"}],"version-history":[{"count":3,"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/posts\/683\/revisions"}],"predecessor-version":[{"id":762,"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/posts\/683\/revisions\/762"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/media\/739"}],"wp:attachment":[{"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/media?parent=683"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/categories?post=683"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/tags?post=683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}