{"id":35,"date":"2015-10-29T17:04:39","date_gmt":"2015-10-29T17:04:39","guid":{"rendered":"http:\/\/blog.paranoidprofessor.com\/?p=35"},"modified":"2015-11-20T09:17:06","modified_gmt":"2015-11-20T09:17:06","slug":"pipes-and-monkey-wrenches","status":"publish","type":"post","link":"https:\/\/blog.paranoidprofessor.com\/index.php\/2015\/10\/29\/pipes-and-monkey-wrenches\/","title":{"rendered":"pipes and monkey wrenches"},"content":{"rendered":"<p>Perhaps this should have been titled &#8220;<strong>backup backup backup<\/strong>&#8220;. This is a mantra that is often told but not as often followed and failing to do so can affect anyone.<\/p>\n<p>I was almost ready to go live with my site when I asked for some assistance. A friend of mine who is familiar with the services of my host helped me with some of the friendly tools that were available. I had mistakenly installed my site under the default instance directory.<\/p>\n<p>The tool, Plesk control panel from ODIN. The tool can probably do it all, mail server, firewall, backup, databases and statistics just to mention a few of its capabilities.<\/p>\n<p>Well, it is no fault of the tool that the wielder is having problems with it. I started on the bare metal and once I\u00a0started to control the environment with Plesk the center of reference moved.<\/p>\n<p>My data was not lost, but the locations for the web pages were moved, and wordpress remembers where it was installed.\u00a0 A quick query of the wp_posts table shows that the posts are there which was what I was concerned with, yet this table also contains any revisions and indeed just like word processing, it is a good idea to save your work often.<\/p>\n<p>I simply extracted my text which now had pipe symbols at various spots in the articles.<\/p>\n<p>There are some simple things that can be done to prevent reliving this situation.<\/p>\n<ul>\n<li>wordpress extraction of data<\/li>\n<li>database backups<\/li>\n<\/ul>\n<p>WordPress provides a pair of scripts designed to extract and import setup.<\/p>\n<p><b><em><code>http::\/example.com\/wp-admin\/export.php<br \/>\nhttp::\/example.com\/wp-admin\/import.php<br \/>\n<\/code><\/em><\/b><\/p>\n<p>The names really do say it all.\u00a0 Simply point your web browser at your site and you can download the extract directly to your computer.<\/p>\n<p>Database backup tools are more of a personal thing.\u00a0 Either find a comfortable front end for mysql or do a bit on the command line.\u00a0 For the moment, I have decided for a small script which will dump the database into a dated file.<br \/>\n<b><em><code><br \/>\n#!\/bin\/bash<br \/>\nDBOWN=myadmin<br \/>\nDBPWD=somepass<br \/>\nDB=mydatabase<br \/>\nmysqldump -u$DBOWN -p$DBPWD $DB &gt; dbdump-`date +%Y%m%d`.sql<br \/>\n<\/code><\/em><\/b><\/p>\n<p>A real paranoid sysadmin would not put the password into the file and would be prompted for a password.<b><em><code><br \/>\n<\/code><\/em><\/b><\/p>\n<p><b><em><code> #!\/bin\/bash<br \/>\nDBOWN=myadmin<br \/>\nDB=mydatabase<br \/>\nmysqldump -u$DBOWN -p $DB &gt; dbdump-`date +%Y%m%d`.sql<br \/>\n<\/code><\/em><\/b><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Perhaps this should have been titled &#8220;backup backup backup&#8220;. This is a mantra that is often told but not as often followed and failing to do so can affect anyone. I was almost ready to go live with my site &hellip; <a href=\"https:\/\/blog.paranoidprofessor.com\/index.php\/2015\/10\/29\/pipes-and-monkey-wrenches\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[26,32,28],"_links":{"self":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/35"}],"collection":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/comments?post=35"}],"version-history":[{"count":7,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/35\/revisions"}],"predecessor-version":[{"id":80,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/35\/revisions\/80"}],"wp:attachment":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/media?parent=35"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/categories?post=35"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/tags?post=35"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}