{"id":50312,"date":"2020-11-11T03:01:09","date_gmt":"2020-11-10T17:01:09","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=50312"},"modified":"2020-11-09T12:04:04","modified_gmt":"2020-11-09T02:04:04","slug":"wordpress-mysql-database-backup-update-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-mysql-database-backup-update-tutorial\/","title":{"rendered":"WordPress MySql Database Backup Update Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress_mysql_database_backup_update.jpg\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"WordPress MySql Database Backup Update Tutorial\" src=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress_mysql_database_backup_update.jpg\" title=\"WordPress MySql Database Backup Update Tutorial\"   \/><\/a><p class=\"wp-caption-text\">WordPress MySql Database Backup Update Tutorial<\/p><\/div>\n<p>Did you already know or did research off <a title='WordPress MySql Database Backup Tutorial' href='#wpmsdbt'>WordPress MySql Database Backup Tutorial<\/a>&#8216;s <a target=_blank title='Data manipulation language information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Data_manipulation_language'>DML<\/a> link regarding &#8230;<\/p>\n<ul>\n<li>DML (Data Manipulation Language) with its 4 6-letter &#8220;verbs&#8221; &#8230;\n<ol>\n<li>SELECT<\/li>\n<li>INSERT<\/li>\n<li>DELETE<\/li>\n<li>UPDATE<\/li>\n<\/ol>\n<p> &#8230; the usual SQL statement verbs behind the scenes of database programming code that performs SQL queries (SELECT) and\/or statements (INSERT\/UPDATE\/DELETE) &#8230; as distinct from &#8230;<\/li>\n<li><a target=_blank title='SQL DDL Description Definition Language information from Wikipedia, thanks' href='https:\/\/en.wikipedia.org\/wiki\/Description_Definition_Language'>DDL<\/a> (Description Definition Language) &#8230;<br \/>\n<blockquote cite=''https:\/\/en.wikipedia.org\/wiki\/Description_Definition_Language'><p>\nDDL (Description Definition Language) is part of the MPEG-7 standard. It gives an important set of tools for the users to create their own Description Schemes (DSs) and Descriptors (Ds). DDL defines the syntax rules to define, combine, extend and modify Description Schemes and Descriptors.\n<\/p><\/blockquote>\n<p> &#8230; is what we like to think of as &#8220;the rest&#8221; of the SQL goings on to set up and maintain your database (our WordPress blog one being a MySql one)\n<\/li>\n<\/ul>\n<p>Our <a href='#sqlid' title='INSERT'>SQL DML INSERT statement<\/a> featuring in <a title='WordPress MySql Database Backup Tutorial' href='#wpmsdbt'>WordPress MySql Database Backup Tutorial<\/a> included a SELECT <i>database derived data subset<\/i>, if you will.  Let&#8217;s categorize the usage of the DML &#8220;verbs&#8221; below &#8230;<\/p>\n<table style=width:100%;>\n<tr>\n<th style='text-align:center;border:1px solid red;' colspan=2>Reading from Database<\/th>\n<th style='text-align:center;border:1px solid blue;' colspan=2>Writing to Database<\/th>\n<\/tr>\n<tr>\n<td style='text-align:center;border:1px solid red;' colspan=2>SELECT<\/td>\n<td colspan=2><\/td>\n<\/tr>\n<tr>\n<td colspan=2><\/td>\n<td style='text-align:center;border:1px solid blue;' colspan=2>INSERT<\/td>\n<\/tr>\n<tr>\n<td colspan=2><\/td>\n<td style='text-align:center;border:1px solid blue;' colspan=2>DELETE<\/td>\n<\/tr>\n<tr>\n<td style='text-align:center;border:1px solid purple;' colspan=4>UPDATE<\/td>\n<\/tr>\n<\/table>\n<p> &#8230; and so, as you might surmise from this, should we continue with  <i>&#8220;frontend meets backend&#8221; WordPress admin &#8220;Create Post&#8221; webpage usage (of the newer version)<\/i> modifications of (blog post) content, this deals with the published blog post data, but to keep the backup inline with this, for example of post ID 47083, the SQL (MySql SQL) to run in <a target=_blank href='http:\/\/www.phpmyadmin.net\/' title='phpMyAdmin home page'>phpMyAdmin<\/a> would be &#8230;<\/p>\n<p><code><br \/>\nUPDATE rjmprogr_wordpress.wp_posts SET post_date=(SELECT post_date FROM itblog.wps_posts WHERE ID=UPDATE rjmprogr_wordpress.wp_posts SET post_date=(SELECT post_date FROM itblog.wps_posts WHERE ID=rjmprogr_wordpress.wp_posts.ID),<br \/>\n post_date_GMT=(SELECT post_date_GMT FROM itblog.wps_posts WHERE ID=rjmprogr_wordpress.wp_posts.ID),<br \/>\n  post_modified=(SELECT post_modified FROM itblog.wps_posts WHERE ID=rjmprogr_wordpress.wp_posts.ID),<br \/>\n   post_modified_GMT=(SELECT post_modified_GMT FROM itblog.wps_posts WHERE ID=rjmprogr_wordpress.wp_posts.ID)<br \/>\n  WHERE ID=47083;<br \/>\n<\/code> <\/p>\n<p> &#8230; again, calling on the SELECT <i>database derived data subset<\/i> concept.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-mysql-database-backup-update-tutorial\/'>WordPress MySql Database Backup Update Tutorial<\/a>.<\/p-->\n<hr>\n<p id='wpmsdbt'>Previous relevant <a target=_blank title='WordPress MySql Database Backup Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-mysql-database-backup-tutorial\/'>WordPress MySql Database Backup Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress_mysql_database_backup.jpg\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"WordPress MySql Database Backup Tutorial\" src=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress_mysql_database_backup.jpg\" title=\"WordPress MySql Database Backup Tutorial\"   \/><\/a><p class=\"wp-caption-text\">WordPress MySql Database Backup Tutorial<\/p><\/div>\n<p>There&#8217;s been a lot of water under the bridge since we upgraded to this WordPress blog (TwentyTen theme) you are reading now, through the work described in the thread of blog posting&#8217;s headed by <a title='WordPress Upgrade Crontab Curl  Tutorial' href='#wpucct'>WordPress Upgrade Crontab Curl  Tutorial<\/a>.  At that time we had two WordPress blogs with almost equivalent posting data and matching post IDs, and we maintained two blogs with two &#8220;frontend meets backend&#8221; WordPress admin &#8220;Create Post&#8221; webpages (of those two different versions).<\/p>\n<p>Since then we&#8217;ve &#8230;<\/p>\n<ul>\n<li>dropped the &#8220;frontend meets backend&#8221; WordPress admin &#8220;Create Post&#8221; webpage usage (of the older version) &#8230; in favour of &#8220;repurposing&#8221; via &#8230;<\/li>\n<li>completely &#8220;backend&#8221; (ie. MySql database access via (the brilliant) <a target=_blank href='http:\/\/www.phpmyadmin.net\/' title='phpMyAdmin home page'>phpMyAdmin<\/a>) backup of <i>&#8220;frontend meets backend&#8221; WordPress admin &#8220;Create Post&#8221; webpage usage (of the newer version)<\/i> content to <i>older version MySql database<\/i> (via phpMyAdmin SQL tab filled with an <i>INSERT<\/i> <a target=_blank title='Data manipulation language information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Data_manipulation_language'>DML<\/a> statement <a href='#sqlid' title='SQL'>as exemplified below<\/a> (<b>not even needing to select a database first<\/b>))<\/li>\n<\/ul>\n<p> &#8230; and that <b>not even needing to select a database first<\/b> feels very liberating somehow, and powerful, to us.  What are we inferring by this?  To us, we think &#8230;<\/p>\n<blockquote><p>\nDatabase Join\n<\/p><\/blockquote>\n<p> &#8230; and the excellent <a target=_blank title=\"O'Reilly\" href='https:\/\/www.oreilly.com\/'>O&#8217;Reilly<\/a> refines it to <a target=_blank title=\"O'Reilly\" href='https:\/\/www.oreilly.com\/library\/view\/mysql-cookbook-2nd\/059652708X\/ch12s15.html'>Join Between Tables in Different Databases<\/a> helping us avoid ambiguity here.<\/p>\n<p>We imagine <a target=_blank title='Big data information from Wikipedia, thanks' href='https:\/\/en.wikipedia.org\/wiki\/Big_data'>&#8220;big data&#8221;<\/a> being interested in such ideas, the comparing of more than one data set.<\/p>\n<p>But you have to have something to hang your hat upon, to compare apples with apples, normally, when trying to make sense of <a target=_blank title='Relational database information from Wikipedia, thanks' href='https:\/\/en.wikipedia.org\/wiki\/Relational_database'>relational database<\/a> data.  In our case, as previously mentioned, it is that (blog) post ID.<\/p>\n<p>With the SQL (MySql SQL) below, we execute it after each session of <i>&#8220;frontend meets backend&#8221; WordPress admin &#8220;Create Post&#8221; webpage usage (of the newer version)<\/i> (and we know what the new WordPress post ID is for that post (exemplified by post ID 47083 below)), and is the major plank in our WordPress blog backup strategy &#8230;<\/p>\n<p><code id=sqlid><br \/>\nINSERT INTO rjmprogr_wordpress.wp_posts (ID,post_author,post_date,post_date_GMT,post_content,post_title,post_excerpt,post_status,post_name,post_modified,post_modified_GMT,guid,post_type,to_ping,pinged) SELECT ID,post_author,post_date,post_date_GMT,<br \/>\nreplace(replace(post_content,'\/p--&gt;','\/p&gt;'),'&lt;!--p','&lt;p'),post_title,post_excerpt,post_status,post_name,post_modified,post_modified_GMT,guid,post_type,to_ping,pinged<br \/>\n FROM itblog.wps_posts WHERE ID=47083;<br \/>\n<\/code><\/p>\n<p> &#8230; admittedly not as thorough as a <a target=_blank title='MySql database dump' href='https:\/\/www.google.com\/search?q=mysql+dump&#038;rlz=1C5CHFA_enAU832AU832&#038;oq=mysql+dump&#038;aqs=chrome..69i57j0l7.3254j0j4&#038;sourceid=chrome&#038;ie=UTF-8'>(MySql) database dump<\/a> or a <a target=_blank title='phpMyAdmin Export' href='https:\/\/www.google.com\/search?q=phpmyadmin+export+database&#038;rlz=1C5CHFA_enAU832AU832&#038;oq=phpMyAdmin+Export&#038;aqs=chrome.0.0j69i57j0l6.3414j0j9&#038;sourceid=chrome&#038;ie=UTF-8'>phpMyAdmin (periodic) Export<\/a>, but &#8220;piecable together<font size=1>able<\/font>&#8221; enough (with some effort) should the horrible eventuality make it necessary to call upon it to piece back together the blog posting content (and surrounding bits and pieces could perhaps be serviced by a reinstall), all allowing peaceful shut eye of a night time.<\/p>\n<p><b><i>Did you know?<\/i><\/b><\/p>\n<p>All of this blog post creation talk above creates an opportunity to explain some of the context of the &#8220;cloning of blog posting from an older one&#8221; ideas presented when we presented <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-blog-posting-applescript-textwrangler-helper-primer-tutorial\/' title='WordPress Blog Posting AppleScript TextWrangler Helper Primer Tutorial'>WordPress Blog Posting AppleScript TextWrangler Helper Primer Tutorial<\/a>.  There, with a TextWrangler script we would end up with &#8230;<\/p>\n<p><code><br \/>\n&lt;p&gt;You can also see this play out at WordPress 4.1.1's &lt;a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/new-wordpress-upgrade-crontab-curl-tutorial\/'&gt;New WordPress Upgrade Crontab Curl  Tutorial&lt;\/a&gt; ...&lt;\/p&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; as a helper outerer for our &#8220;content patterns&#8221; here at RJM Programming (based on &#8220;older post&#8221; content).  These days, to fit in with the SQL (MySql SQL) above quirky &#8220;replace(replace(post_content,&#8217;\/p&#8211;&gt;&#8217;,&#8217;\/p&gt;&#8217;),'&lt;!&#8211;p&#8217;,'&lt;p&#8217;)&#8221; bit we change that &#8220;clone content&#8221; to &#8230;<\/p>\n<p><code><br \/>\n&lt;!--p&gt;You can also see this play out at WordPress 4.1.1's &lt;a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-mysql-database-backup-tutorial\/'&gt;WordPress MySql Database Backup Tutorial&lt;\/a&gt;.&lt;\/p--&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; while &#8220;in the old days&#8221; we&#8217;d have had content &#8230;<\/p>\n<p><code><br \/>\n&lt;p&gt;You can also see this play out at WordPress 4.1.1's &lt;a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-mysql-database-backup-tutorial\/'&gt;WordPress MySql Database Backup Tutorial&lt;\/a&gt;.&lt;\/p&gt;<br \/>\n<\/code><\/p>\n<hr>\n<p id='wpucct'>Previous relevant <a target=_blank title='WordPress Upgrade Crontab Curl  Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-upgrade-crontab-curl-tutorial\/'>WordPress Upgrade Crontab Curl  Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wpupfuilcc.jpg\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"WordPress Upgrade Crontab Curl Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wpupfuilcc.jpg\" title=\"WordPress Upgrade Links Tutorial\"   \/><\/a><p class=\"wp-caption-text\">WordPress Upgrade Crontab Curl  Tutorial<\/p><\/div>\n<p><a title='WordPress Upgrade Links Tutorial' href='#wult'>Yesterday<\/a>&#8216;s work with the WordPress upgrade from 3.0.3 to 4.1.1 &#8230; and &#8220;letting go&#8221; (of 3.0.3) thoughts mentioned &#8230;<\/p>\n<blockquote>\n<p> &#8230; but not yet moving to any generic mappings via the WordPress 3.0.3&#8217;s index.php nor any .htaccess \/ httpd.config arrangements for this, just yet, as we have an issue with the blog posts during this interim period where the &#8220;?p=[postId]&#8221; doesn&#8217;t always match, and we have to plan what to do about this, and not be too kludgy &#8230; for the future.<\/p>\n<\/blockquote>\n<p> &#8230; we&#8217;ve, today, been working on a &#8220;not too&#8221; kludgy approach, and there seem to be a lot of good aspects to the solution, especially being able to again deploy good ol&#8217; <a target=_blank href='http:\/\/www.computerhope.com\/unix\/ucrontab.htm' title='Crontab information from computerhope'>Crontab<\/a> and <a target=_blank href='http:\/\/www.computerhope.com\/unix\/curl.htm' title='Curl information from computerhope'>Curl<\/a> &#8230; <a target=_blank title='Benny Hill' href='https:\/\/www.youtube.com\/watch?v=8e1xvyTdBZI'>and they drove the fastest milk cart, in the West<\/a> &#8230; so this is <a href='#furtherdown' title='Later thoughts'>a small time scan after daily publish period of perusal to check for and fix the mismatched IDs<\/a> method.   The method, though, may stuff up some category and tag arrangements with the WordPress 3.0.3 blog postings during this interim period.<\/p>\n<p>The solution today involved the concept of doing a MySql database SQL query that joins two tables from different databases &#8230;<\/p>\n<p><code><br \/>\nSELECT t1.ID, t2.ID, t1.post_title, t2.post_title, substr(t1.guid, instr(t1.guid, '\/ITblog\/')) as t1g, substr(t2.guid, instr(t2.guid, '\/wordpress\/')) as t2g<br \/>\nFROM itblog.wps_posts t1<br \/>\nJOIN rjmprogr_wordpress.wp_posts t2<br \/>\nON t2.post_title = t1.post_title and t2.post_status in ('publish','future') and t1.post_status in ('publish','future')<br \/>\nWHERE t2.ID != t1.ID<br \/>\n<\/code><\/p>\n<p> &#8230; and want to thank this useful <a target=_blank title='Useful link' href='http:\/\/stackoverflow.com\/questions\/5698378\/mysql-join-between-tables-in-2-different-databases'>link<\/a> for advice here.<\/p>\n<p>The way to approach this solution takes a well trodden path &#8230; nothing much unusual here &#8230; the wonderful, the marvellous, the refreshingly curious and the curiously refreshing <a target=_blank href='http:\/\/www.phpmyadmin.net\/' title='phpMyAdmin home page'>phpMyAdmin<\/a> is used to &#8220;unit test&#8221; the heart of the solution &#8230; ie. &#8220;finding the candidates&#8221; &#8230; thinking on it the idea could be summarized with a lot of database work &#8230;<\/p>\n<ol>\n<li>query the database with &#8220;SELECT&#8221; to &#8220;find the candidates&#8221;<\/li>\n<li>for each candidate, &#8220;UPDATE&#8221; and\/or &#8220;DELETE&#8221; and\/or &#8220;INSERT&#8221; to database to act on the problem and fix<\/li>\n<\/ol>\n<p> &#8230; and phpMyAdmin is greatly useful to &#8220;unit test&#8221; step 1 above, in particular.<\/p>\n<p>Time for the PHP code (that we Curl) now, that you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/old_new_wp_mismatch_id.php_GETME\" title='old_new_wp_mismatch_id.php'>old_new_wp_mismatch_id.php<\/a>, which uses that unit tested SQL query, then does &#8220;UPDATE&#8221; to change existing records of, in order of preference &#8230;<\/p>\n<ol>\n<li>change the WordPress 3.0.3 ID and guid to suit the WordPress 4.1.1 ID<\/li>\n<li>in case of ID duplicate clashes change both  WordPress 3.0.3 ID (+ guid) and WordPress 4.1.1 ID (+ guid) to a new &#8220;biggest in both&#8221; value<\/li>\n<\/ol>\n<p>So now that the code is developed, it goes through a &#8220;unit testing&#8221; phase with Curl but no &#8220;Crontab&#8221;.<\/p>\n<p id='furtherdown'>Then finally &#8220;Crontab&#8221; batch processing is introduced, and this needs less testing, unless you want to simulate a set time run of it.  The <b>bold<\/b> bit of the SQL &#8230;<\/p>\n<p><code><br \/>\nSELECT t1.ID, t2.ID, t1.post_title, t2.post_title, substr(t1.guid, instr(t1.guid, '\/ITblog\/')) as t1g, substr(t2.guid, instr(t2.guid, '\/wordpress\/')) as t2g<br \/>\nFROM itblog.wps_posts t1<br \/>\nJOIN rjmprogr_wordpress.wp_posts t2<br \/>\nON t2.post_title = t1.post_title and t2.post_status in ('publish'<b>,'future'<\/b>) and t1.post_status in ('publish'<b>,'future'<\/b>)<br \/>\nWHERE t2.ID != t1.ID<br \/>\n<\/code><\/p>\n<p> &#8230; allows for the idea that an interactive &#8220;non-Crontab&#8221; call of <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/old_new_wp_mismatch_id.php_GETME\" title='old_new_wp_mismatch_id.php'>old_new_wp_mismatch_id.php<\/a> that would be meaningful just after creating the linking blog posts in both WordPress 3.0.3 and WordPress 4.1.1, but we will proceed with the Crontab arrangement for surety of the process.  After all, a ham sandwich can reduce concentration levels &#8230; <a target=_blank href='http:\/\/www.youtube.com\/watch?v=oq79Zl25J7Y' title='?'>case in point<\/a> &#8230; we rest our cases.<\/p>\n<p>This also meant that the time to &#8220;do the Crontab&#8221; can be tied down better than <i>&#8220;a small time scan after daily publish period of perusal to check for and fix the mismatched IDs&#8221;<\/i> as we discussed above, to result in a  Crontab record like &#8230;<\/p>\n<p><code><br \/>\n17 1 * * * curl http:\/\/www.rjmprogramming.com.au\/PHP\/old_new_wp_mismatch_id.php<br \/>\n<\/code><\/p>\n<p> &#8230; so that it happens once a day before the <strike>one<\/strike> two &#8220;Scheduled&#8221; blog <strike>post<\/strike> posts (which is how we normally arrange things) turns into <strike>a<\/strike> &#8220;Published&#8221; <strike>one<\/strike> ones.<\/p>\n<p>Anyway, hope you get an idea or more from today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wpupfuilcc.jpg\" title='Click picture'>tutorial<\/a>.<\/p>\n<hr>\n<p id='wult'>Previous relevant <a target=_blank title='WordPress Upgrade Links Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=14410'>WordPress Upgrade Links Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wpupfuil.jpg\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"WordPress Upgrade Links Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wpupfuil.jpg\" title=\"WordPress Upgrade Links Tutorial\"   \/><\/a><p class=\"wp-caption-text\">WordPress Upgrade Links Tutorial<\/p><\/div>\n<p>Here is today&#8217;s &#8220;moving forward&#8221; moment regarding our WordPress upgrade from version 3.0.3 to 4.1.1.   You may be wondering how relevant this is to you, and it may not be immediately applicably relevant, but you may find the approaches of generic interest when you upgrade any website and are in that in between period of settling the new website in, but not ready to let the old one go.<\/p>\n<p>Another consideration regarding &#8220;let the old one go&#8221; is, if you do move on, will the dead links on the search engines pointing at your old version mean your domain is penalized because of these dead links.  Perhaps an .htaccess \/ httpd.config arrangement left behind will fix this, but am not up to that yet.  Experts are welcome to leave comments.  This, I am not sure about, but within your own blog broken links can be checked by a WordPress plugin you can read about at <a target=_blank title='Broken Link Checker' href='https:\/\/wordpress.org\/plugins\/broken-link-checker\/'>Broken Link Checker<\/a>.<\/p>\n<p>Okay, so we&#8217;re not <a target=_blank title='Throwing out the baby with the bath water' href='http:\/\/en.wikipedia.org\/wiki\/Throw_out_the_baby_with_the_bath_water'>&#8220;throwing out the baby with the bath water&#8221;<\/a> and so how can we chip away at getting users to use the new blog website?  How about &#8230;<\/p>\n<ol>\n<li>the Recent Posts widget links<\/li>\n<li>the blog Entry Title (class=&#8217;entry-title&#8217;) light blue links on the blog<\/li>\n<\/ol>\n<p> &#8230; but not yet moving to any generic mappings via the WordPress 3.0.3&#8217;s index.php nor any .htaccess \/ httpd.config arrangements for this, just yet, as we have an issue with the blog posts during this interim period where the &#8220;?p=[postId]&#8221; doesn&#8217;t always match, and we have to plan what to do about this, and not be too kludgy &#8230; for the future.<\/p>\n<p>So what are the code changes for steps 1 and 2 above &#8230; both, further below, need new <a target=_blank title='wajax.js' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/wajax.js---------------GETME'>wajax.js<\/a> (and same for <a target=_blank title='nothing.js' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/nothing.js--GETME'>nothing.js<\/a>) function &#8230; <\/p>\n<p><code><br \/>\nfunction newblogmap(tworpinnerHTML, kj) {   \/\/ ?p=[postId] wordpress old to \/%postname%\/ permalink ITblog new ... April, 2015 ... RJM<br \/>\n  var iqwa, newidea, nideatwo, aih, aihtwo, aword, awords, niword, retval = tworpinnerHTML;<br \/>\n  if (tworpinnerHTML.indexOf(\"?p=\") != -1) {<br \/>\n  newidea = tworpinnerHTML.split(\"<\/a>\");<br \/>\n  for (iqwa=0; iqwa&lt;(newidea.length - 1); iqwa++) {<br \/>\n  if (iqwa == kj) {<br \/>\n  aih = newidea[iqwa].split(\"&gt;\");<br \/>\n  awords = aih[(aih.length - 1)].split(\" ...\");<br \/>\n  \/\/if (awords[0].indexOf(\"Walking Trip\") != -1 && document.URL.indexOf(\"?x=x\") != -1) alert(\"*\" + awords[0] + \"*\");<br \/>\n  niword = awords[0].toLowerCase().replace(\/\\\/\/g, \"\").replace(\/,\/g, \"\");<br \/>\n  \/\/if (awords[0].indexOf(\"Walking Trip\") != -1 && document.URL.indexOf(\"?x=x\") != -1) alert(\"!\" + niword + \"*\");<br \/>\n  niword = niword.trim();<br \/>\n  \/\/if (awords[0].indexOf(\"Walking Trip\") != -1 && document.URL.indexOf(\"?x=x\") != -1) alert(\"$\" + niword + \"*\");<br \/>\n  niword = \"\/ITblog\/\" + niword.replace(\/ \/g, \"-\") + \"\/\";<br \/>\n  if (awords[0].indexOf(\"Walking Trip\") != -1) niword = \"\/ITblog\/walking-trip\/\";<br \/>\n  nideatwo = newidea[iqwa].split(\"?p=\");<br \/>\n  if (nideatwo.length > 1) {<br \/>\n    aih = nideatwo[1].split('\"');<br \/>\n    aihtwo = nideatwo[1].split(\"'\");<br \/>\n    if (aih[0].length < aihtwo[0].length) {\n      aihtwo = aih[0].split(\"&#038;\");\n      aword = \"\/wordpress\/?p=\" + aihtwo[0];\n    } else {\n      aih = aihtwo[0].split(\"&#038;\");\n      aword = \"\/wordpress\/?p=\" + aih[0];\n    }\n    retval = retval.replace(aword + \"&#038;\", niword + \"?\").replace(aword + \"&#038;\", niword + \"?\").replace(aword, niword).replace(aword, niword);\n  }\n  }\n  }\n  }\n  return retval;\n}\n<\/code><\/p>\n<ol>\n<li>the Recent Posts widget links ... and we talked about this with <a target=_blank title='WordPress Recent Post Image Follow Up Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=11008'>WordPress Recent Post Image Follow Up Tutorial<\/a> and\/or <a target=_blank title='WordPress Recent Post Image Follow Up Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-recent-post-image-follow-up-tutorial\/'>WordPress Recent Post Image Follow Up Tutorial<\/a> ... bold bits below ... affects wajax.js (and same for nothing.js) ...<br \/>\n<code><br \/>\n...<br \/>\nfunction winit() {<br \/>\n...<br \/>\n      for (var j=0; j < allPs.length; j++) {\n         if (allPs[j].id == \"text-4\") {\n...\n         } else if (allPs[j].id == \"text-5\")  {\n...\n         } else if (allPs[j].id == \"recent-posts-2\")  {   \/\/ Recent blog post Ajax previews 27\/11\/2014        \n           var ihs = allPs[j].innerHTML.split(\"?p=\");\n           var myposts;\n           var aeight=new Array(\"aone\", \"atwo\", \"athree\", \"afour\", \"afive\", \"asix\", \"aseven\", \"aeight\");\n           var ieight = aeight.length - 1;\n           for (var jhs=(ihs.length - 1); jhs>=1; jhs--) {<br \/>\n             myposts = ihs[jhs].split('\"');<br \/>\n             if ((wisiPad || wisTouch)) {<br \/>\n             if (allPs[j].innerHTML.indexOf('a href=\"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=' + myposts[0] + '\" t') != -1) {<br \/>\n             allPs[j].innerHTML = allPs[j].innerHTML.replace('a href=\"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=' + myposts[0] + '\" title=\"', 'a href=\"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=' + myposts[0] + '\" style=\"margin-bottom:20px;\" ontouchend=\" yehbut(); \" id=\"' + aeight[ieight] + '\" ontouchstart=\" bpost=' + myposts[0] + ';  if (mtimer) { clearInterval(mtimer); }  tickcnt = 0; mtimer = setInterval(mchecker, 1000);  \" title=\"You can wait for the long hover functionality for a Blog Post preview ... ');<br \/>\n             } else {<br \/>\n             allPs[j].innerHTML = allPs[j].innerHTML.replace('\" href=\"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=' + myposts[0] + '\"', ' ... you can wait for the long hover functionality for a Blog Post preview\" href=\"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=' + myposts[0] + '\" style=\"margin-bottom:20px;\" ontouchend=\" yehbut(); \" id=\"' + aeight[ieight] + '\" ontouchstart=\"  bpost=' + myposts[0] + ';  if (mtimer) { clearInterval(mtimer); }  tickcnt = 0; mtimer = setInterval(mchecker, 1000);  \" ');<br \/>\n             }<br \/>\n             <b>if (1 == 2) allPs[j].innerHTML = newblogmap(allPs[j].innerHTML, eval(jhs - 1));   \/\/ not yet for mobile - map to new blog URL with permalink \/%postname%\/<\/b><br \/>\n             } else {<br \/>\n             if (allPs[j].innerHTML.indexOf('a href=\"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=' + myposts[0] + '\" t') != -1) {<br \/>\n             allPs[j].innerHTML = allPs[j].innerHTML.replace('a href=\"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=' + myposts[0] + '\" title=\"', 'a href=\"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=' + myposts[0] + '\" onmouseout=\" yehbut(); \" id=\"' + aeight[ieight] + '\" style=\"margin-bottom:20px;\" onmouseover=\"  bpost=' + myposts[0] + '; setTimeout(xget, 4000); \" title=\"You can wait for the long hover functionality for a Blog Post preview ... ');<br \/>\n             } else {<br \/>\n             allPs[j].innerHTML = allPs[j].innerHTML.replace('\" href=\"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=' + myposts[0] + '\"', ' ... you can wait for the long hover functionality for a Blog Post preview\" href=\"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=' + myposts[0] + '\" onmouseout=\" yehbut(); \" id=\"' + aeight[ieight] + '\" style=\"margin-bottom:20px;\" onmouseover=\"  bpost=' + myposts[0] + '; setTimeout(xget, 4000); \" ');<br \/>\n             }<br \/>\n             <b>allPs[j].innerHTML = newblogmap(allPs[j].innerHTML, eval(jhs - 1));   \/\/ map to new blog URL with permalink \/%postname%\/<\/b><br \/>\n             }<br \/>\n             ieight = ieight - 1;<br \/>\n           }<br \/>\n      }<br \/>\n...<br \/>\n}<br \/>\n...<br \/>\n<\/code>\n<\/li>\n<li>the blog Entry Title (class='entry-title') light blue links on the blog ... bold bits below ... affects wajax.js (and same for nothing.js) ...<br \/>\n<code><br \/>\n...<br \/>\nfunction winit() {<br \/>\n...<br \/>\n      for (var j=0; j < allPs.length; j++) {\n         hdivid = allPs[j].id;\n         if (typeof hdivid == \"undefined\") {\n           hdivid = \"\";\n         } else {\n           if (hdivid.indexOf(\"post-\") != -1) {\n             hdivids = (hdivid.substring(hdivid.indexOf(\"post-\")) + \" \").split(\" \");\n             hdivid = hdivids[0];\n             hdivids = allPs[j].innerHTML.split(' class=\"entry-title\">');<br \/>\n             if (hdivids.length > 1) {<br \/>\n             clname = (\"~\" + hdivids[1]).replace('~<',' ').replace('~','');\n             hdivids = clname.split(\"<\");\n             if (hdivid != \"\" &#038;&#038; hdivids[0] != \"\") {\n               if (hdivids[0].indexOf(\">\") != -1) {<br \/>\n                clname = hdivids[0];<br \/>\n                hdivids = clname.split(\">\");<br \/>\n                hdivids[0] = hdivids[hdivids.length - 1];<br \/>\n                <b>if ((wisiPad || wisTouch)) {<br \/>\n                 wisiPad = wisiPad;<br \/>\n                } else {<br \/>\n                 allPs[j].innerHTML = newblogmap(allPs[j].innerHTML, 0); \/\/ map to new blog with permalink \/%postname%\/<br \/>\n                }<\/b><br \/>\n               }<br \/>\n               if (hrsel.length == 0) {<br \/>\n                hrsel = \"&lt;select onchange='location.href=this.value;' id='hrsel' style='display:NONE;'&gt;&lt;OPTION value='#\" + hdivid + \"'&gt;\" + hdivids[0] + \"&lt;\/option&gt;&lt;\/select&gt;&lt;br&gt;\";<br \/>\n               } else if (hrsel.indexOf(hdivids[0]) == -1) {<br \/>\n                hrsel = hrsel.replace(\"&lt;\/option&gt;&lt;\/select&gt;\", \"<\/option&gt;&lt;OPTION value='#\" + hdivid + \"'&gt;\" + hdivids[0] + \"&lt;\/option&gt;&lt;\/select&gt;\");\n               }\n             }\n            }\n           }\n         }\n         if (allPs[j].id == \"access\") {\n           if ((wisiPad || wisTouch)) {\n           allPs[j].ontouchstart = getGradient;\n           allPs[j].ontouchend = yehBut;\n           } else {\n           allPs[j].onmouseover = getGradient;  \/\/ 10640\n           if (allPs[j].title.indexOf(\" ...\") == -1) {\n             allPs[j].title = allPs[j].title + \" ... welcome to the long hover functionality that shows Blog Post regarding CSS3 Gradient\";\n           }\n           allPs[j].onmouseout = yehBut;\n           }\n         }\n      }\n...\n      if (navigator.userAgent.toLowerCase().indexOf(\"ie\") != (0 - 1)) {\n       allPs = document.getElementsByTagName('p');\n      } else {\n       allPs= document.getElementsByTagName('p');\n      }\n...\n      for (var j=0; j < allPs.length; j++) {\n         hdivid = allPs[j].id;\n         if (typeof hdivid == \"undefined\") {\n             hdivid = \"\";\n         } else {\n             hdivids = allPs[j].innerHTML.split(\">\");<br \/>\n             if (hdivids.length > 1) {<br \/>\n             clname = (\"~\" + hdivids[1]).replace('~<',' ').replace('~','');\n             hdivids = clname.split(\"<\");\n             if (hdivids[0].indexOf(\">\") != -1) {<br \/>\n              clname = hdivids[0];<br \/>\n              hdivids = clname.split(\">\");<br \/>\n              hdivids[0] = hdivids[hdivids.length - 1];<br \/>\n                <b>if ((wisiPad || wisTouch)) {<br \/>\n                 wisiPad = wisiPad;<br \/>\n                } else {<br \/>\n                 allPs[j].innerHTML = newblogmap(allPs[j].innerHTML, 0); \/\/ map to new blog with permalink \/%postname%\/<br \/>\n                }<\/b><br \/>\n             }<br \/>\n             if ((hrsel + \"*\").indexOf(\"&lt;option \") == -1 || hrsel.length == 0) {<br \/>\n              if (hdivid != \"\" && hdivids[0] != \"\") {<br \/>\n               if (hrsel.length == 0) {<br \/>\n                 hrsel = \"&lt;select onchange='location.href=this.value;' id='hrsel' style='display:NONE;'&gt;&lt;option value='#\" + hdivid + \"'&gt;\" + hdivids[0] + \"&lt;\/option&gt;&lt;\/select&gt;&lt;br&gt;\";<br \/>\n               } else if (hdivids[0].substring(0,1) &gt;= \"A\" && hdivids[0].substring(0,1) &lt;= \"Z\" && hrsel.indexOf(hdivids[0]) == -1) {<br \/>\n                 hrsel = hrsel.replace(\"&lt;OPTION \", \"&lt;option value='#\" + hdivid + \"'&gt;\" + hdivids[0] + \"&lt;\/option&gt;&lt;OPTION \");<br \/>\n               } else if (hdivids[0].substring(0,1) &gt;= \"A\" && hdivids[0].substring(0,1) &lt;= \"Z\") {<br \/>\n                 hrsel = hrsel.replace(\"&lt;OPTION \", \"&lt;option \");<br \/>\n               }<br \/>\n              }<br \/>\n             } else {<br \/>\n              if (hdivid != \"\" && hdivids[0] != \"\") {<br \/>\n               if (hrsel.length == 0) {<br \/>\n                 hrsel = \"&lt;select onchange='location.href=this.value;' id='hrsel' style='display:NONE;'&gt;&lt;option value='#\" + hdivid + \"'&gt;\" + hdivids[0] + \"&lt;\/option&gt;&lt;\/select&gt;&lt;br&gt;\";<br \/>\n               } else if (hdivids[0].substring(0,1) &gt;= \"A\" && hdivids[0].substring(0,1) &lt;= \"Z\" && hrsel.indexOf(hdivids[0]) == -1) {<br \/>\n                hrsel = hrsel.replace(\"&lt;\/option&gt;&lt;\/select&gt;\", \"&lt;\/option&gt;&lt;option value='#\" + hdivid + \"'&gt;\" + hdivids[0] + \"&lt;\/option&gt;&lt;\/select&gt;\");<br \/>\n               }<br \/>\n              }<br \/>\n             }<br \/>\n             }<br \/>\n         }<br \/>\n      }<br \/>\n...<br \/>\n}<br \/>\n...<br \/>\n<\/code>\n<\/li>\n<\/ol>\n<p>Hope this also can help in some way for your work.<\/p>\n<hr>\n<p id=\"\">Previous relevant <a target=_blank title='WordPress Upgrade Implications Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-upgrade-implications-tutorial\/'>WordPress Upgrade Implications Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wpupfui.jpg\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"WordPress Upgrade Implications Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wpupfui.jpg\" title=\"WordPress Upgrade Implications Tutorial\"   \/><\/a><p class=\"wp-caption-text\">WordPress Upgrade Implications Tutorial<\/p><\/div>\n<p>Yesterday we saw with <a title='WordPress Upgrade Follow Up Tutorial' href='#wufut'>WordPress Upgrade Follow Up Tutorial<\/a> as shown below that WordPress has a great Export and Import <a target=_blank href='https:\/\/wordpress.org\/plugins\/wp-exporter\/' title='WordPress Export and Importer plugin'>plugin<\/a> to help migrate data after you upgrade your WordPress version.  By the way, it is worth noting with this, that two WordPress default <a target=_blank title='WordPress widget information' href='http:\/\/codex.wordpress.org\/WordPress_Widgets'>Widgets<\/a> are useful as sanity checks for how the data migration is going ...<\/p>\n<ol>\n<li>Archives and\/or<\/li>\n<li>Calendar<\/li>\n<\/ol>\n<p> ... particularly if you are like us, and publish once a day.<\/p>\n<p>Anyway, it is now time, once you are happy with data migration to turn to the implications of a happy data migration which is one where the default permalink \"?p=[postId]\" is equivalent for old and new websites, but the new website also accepts \"\/%postname%\/\" permalinks (in our case).  This means that, with care, instead of \"\/wordpress\/\" being in users' URLs you can ease them into \"\/ITblog\/\" replacing that in their URLs.  So why the trepidation, why the \"with care\" bit?  Well, I'm not sure, to be honest, whether all this contravenes a fairly big search engine (SEO) sin of having duplicate data.  I'm, of course, hoping that with the search engine view of the Blog Post titles having that extra (middle name) \"James\" in them, plus a different \"\/%postname%\/\" permalink URL associated with them (but unfortunately with the same content) whether this will be enough to potter along for a while with both WordPress versions, while all the teething issues are sorted out, or whether the data migration will cause grief at the search engines ... am an optimist here, but will keep you posted on that.   You may wonder, why don't we just cut over ... well, maybe, one day, but am sure it is a thing to ease into, rather than a snap decision, especially as the snap decision does not improve anything about the \"duplicate content\" doubt up at the search engines.<\/p>\n<p>So, back at the matter at hand ... considerations of what can improve once a good data migration is achieved.  Here's one we can think of.  If you are an attentive reader at this blog you may know about the PHP code of <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/PHP\/recent-posts-2.php---GETME' title='recent-posts-2.php'>recent-posts-2.php<\/a> which was first talked about with <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-recent-post-image-primer-tutorial\/' title='WordPress Recent Post Image Primer Tutorial'>WordPress Recent Post Image Primer Tutorial<\/a> and last changed (and talked about first regarding that) with <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/ffmpeg-image-optimization-primer-tutorial\/' title='FFmpeg Image Optimization Primer Tutorial'>FFmpeg Image Optimization Primer Tutorial<\/a>.  Well, we changed the code as per <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/recent-posts-2.php---GETME' title='recent-posts-2.php'>this link<\/a> because now wherever a URL has \"\/wordpress\/\" it can now be safely mapped to \"\/ITblog\/\" and be hooking into the new WordPress blog website that way, as reflected by <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/PHP\/zero.html' title='zero.html'>zero.html<\/a><\/p>\n<p>So over coming days recognising these functionality improvements could be the go (like, do we do some <i>.htaccess<\/i> work or rather what we lean towards now, some mapping amendments at the WordPress 3.0.3 index.php end of things?), and it occurs to us to leave several days (to try things out (perhaps on a MAMP local web server, first)) for WordPress Blog upgrade work, to facilitate the changeover methodically.  In the meantime here is today's <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wpupfui.jpg\" title='Click picture'>functionality change<\/a>.<\/p>\n<\/p>\n<p><b>Did you know?<\/b><\/p>\n<p>With using permalink \/%postname%\/ it sets you, on a Linux web server, in particular, to think about URL uppercase\/lowercase confusion.  After all, it is natural that somebody will wonder, with a URL such as ...<\/p>\n<p><code>https:\/\/www.rjmprogramming.com.au\/ITblog\/swift-dictionaries-and-arrays-primer-tutorial\/<\/code><\/p>\n<p> ... whether ... <\/p>\n<p><code>http:\/\/www.rjmprogramming.com.au\/itblog\/swift-dictionaries-and-arrays-primer-tutorial\/<\/code><\/p>\n<p> ... or even ...<\/p>\n<p><code>http:\/\/www.rjmprogramming.com.au\/ITBLOG\/swift-dictionaries-and-arrays-primer-tutorial\/<\/code><\/p>\n<p> ... would also work, and with Apache \/ mod_rewrite \/ .htaccess  \/ httpd.conf considerations ... yes, it is possible (as long as mod_rewrite is installed).  Let's look at the web server alternative to <i>ITblog<\/i> folder called <i>itblog<\/i> (gobsmacked Windows (perhaps ASP.Net web server) afficianados cannot have this differentiation but also don't have the issue to worry about in the first place ... here's the HTML <i>a<\/i> element information from w3schools in <a target=_blank title='HTML a link advice from w3schools in lowercase' href='http:\/\/www.w3schools.com\/tags\/tag_a.asp'>lowercase<\/a> and (bits of) <a target=_blank title='Same HTML a link advice from w3schools in (bits of) uppercase' href='http:\/\/www.w3schools.com\/TagS\/tag_a.asp'>uppercase<\/a> (with its URL) ... anyone for a bit of I.T. <a target=_blank href='http:\/\/en.wikipedia.org\/wiki\/8.3_filename' title='DOS 8 letter filenames information from Wikipedia ... thanks'>history<\/a>?) and what that new web server folder needs to make this happen to have this extra \"convenience\" ...<\/p>\n<ol>\n<li>httpd.conf change (for us, here, because we only allow .htaccess functionality, on a folder by folder decision basis ... changes to httpd.conf need an Apache restart to happen, but a change to .htaccess should not need such a restart for the change to take effect)<br \/>\n<code><br \/>\n&lt;Directory [path to new <i>itblog<\/i> directory]&gt;<br \/>\n    # ... other directives...<br \/>\n    AllowOverride All<br \/>\n &lt;\/Directory&gt;<br \/>\n<\/code>\n<\/li>\n<li>.htaccess (in new <i>itblog<\/i> directory ... chmod 644 ... in large part, the same as WordPress installation's .htaccess file created in the <i>ITblog<\/i> directory)<br \/>\n<code><br \/>\n# BEGIN WordPress<br \/>\n&lt;IfModule mod_rewrite.c&gt;<br \/>\nRewriteEngine On<br \/>\nRewriteBase \/itblog\/<br \/>\nRewriteRule ^index\\.php$ - [L]<br \/>\nRewriteCond %{REQUEST_FILENAME} !-f<br \/>\nRewriteCond %{REQUEST_FILENAME} !-d<br \/>\nRewriteRule . \/ITblog\/index.php [L]<br \/>\n&lt;\/IfModule&gt;<br \/>\n# END WordPress<\/code>\n<\/li>\n<li>index.html (in new <i>itblog<\/i> directory)<br \/>\n<code><br \/>\n&lt;html&gt;                                                                       &lt;body onload=\" location.href = document.URL.replace('\/itblog', '\/ITblog'); \"&gt;                                                                              &lt;\/body&gt;                                                                      &lt;\/html&gt;<br \/>\n<\/code>\n<\/li>\n<li>index.php (in new <i>itblog<\/i> directory)<br \/>\n<code><br \/>\n&lt;?php                                                                              header(\"Location: ..\/ITblog\/index.php?\" . $_SERVER['QUERY_STRING']);                                                         ?&gt;<br \/>\n<\/code>\n<\/li>\n<\/ol>\n<p> ... meaning that a misspelled URL with \"\/itblog\" (which is quite understandable) should function the same as the \"\/ITblog\" version.<\/p>\n<hr>\n<p id='wufut'>Previous relevant <a target=_blank title='WordPress Upgrade Follow Up Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-upgrade-follow-up-tutorial\/'>WordPress Upgrade Follow Up Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wpupfu.jpg\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"WordPress Upgrade Follow Up Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wpupfu.jpg\" title=\"WordPress Upgrade Follow Up Tutorial\"   \/><\/a><p class=\"wp-caption-text\">WordPress Upgrade Follow Up Tutorial<\/p><\/div>\n<p>WordPress has a great Export and Import <a target=_blank href='https:\/\/wordpress.org\/plugins\/wp-exporter\/' title='WordPress Export and Importer plugin'>plugin<\/a> to help migrate data after you upgrade your WordPress version, perhaps.<\/p>\n<p>This came to the fore yesterday when we started (there is a lot more to do) on that migration path going from WordPress version 3.0.3 to version 4.1.1 as you can read a bit about with <a title='WordPress Upgrade Primer Tutorial' href='#wupt'>WordPress Upgrade Primer Tutorial<\/a> as shown below.<\/p>\n<p>So the two parts to the Export and Import equation are ...<\/p>\n<ol>\n<li>Export from WordPress 3.0.3<\/li>\n<li>Import into WordPress 4.1.1<\/li>\n<\/ol>\n<p>... now you may naively think that you will be able to export once and import once, but various things may get in your way achieving that ...<\/p>\n<ol>\n<li>the small settings for max_execution_time (eg. 30 should be temporarily 360) and max_input_time (eg. 60 should be temporarily 120) and memory_limit (eg. 70M should be temporarily 128M) in php.ini need to suit the memory requirements needed to create the Export file you upload to the live server<\/li>\n<li>even fixing requirement for step 1 you may (or the symptom of needing to do something as advised in step 1), as you Export, get the PHP error message \"Fatal error:  Maximum execution time of ? seconds exceeded in ...\" ... where ? was 30 for us here ... this error message will appear in the last line of the Export file so <br \/><i><a target=_blank title='Linux tail command information from computerhope' href='http:\/\/www.computerhope.com\/unix\/utail.htm'>tail<\/a> -2 wordpress.2014-04-01.2014-07-01.xml<\/i><\/br> would have been a Linux programmatical way of checking for the scenario shown a bit below<\/li>\n<li>the small settings for upload_max_filesize (eg. 2M should be temporarily 32M) and post_max_size (eg. 8M should be temporarily 32M) in php.ini need to suit the size of the Import file you upload to the live server<\/li>\n<li>even fixing requirement for step 3 you may (or the symptom of needing to do something as advised in step 3), as you Import, get the PHP error message \"Fatal Error: Allowed Memory Size of ? Bytes Exhausted\" ... where ? is a fairly big number ... and this error message may show on your web page window<\/li>\n<\/ol>\n<p>So it is probably better to do this job in chunks.  We think if there is a blog posting each day a three month span (or perhaps one month span) of Export could be good if comments are included as well.  And how to exclude the comments?   Supposing your Start Date is April 2014 and End Date is June 2014 then, at Linux ...<\/p>\n<p><code><br \/>\n$ <a target=_blank title='Linux cat command information from computerhope' href='http:\/\/www.computerhope.com\/unix\/ucat.htm'>cat<\/a> wordpress.2014-04-01.2014-07-01.xml | <a target=_blank title='Linux awk command information from computerhope' href='http:\/\/www.computerhope.com\/unix\/used.htm'>sed<\/a> '\/^[ \\t]*&lt;wp:comment&gt;\/s\/\/&lt;wp:comment&gt;\/g' | sed '\/^[ \\t]*&lt;\\\/wp:comment&gt;\/s\/\/&lt;\\\/wp:comment&gt;\/g' &gt; xwordpress.2014-04-01.2014-07-01.xml<br \/>\n$ cat xwordpress.2014-04-01.2014-07-01.xml | <a target=_blank title='Linux awk command information from computerhope' href='http:\/\/www.computerhope.com\/unix\/uawk.htm'>awk<\/a> '\/&lt;wp:comment&gt;\/,\/&lt;\\\/wp:comment&gt;\/' &gt; comment_2014_4.xml<br \/>\n$ <a target=_blank title='Linux comm command information from computerhope' href='http:\/\/www.computerhope.com\/unix\/ucomm.htm'>comm<\/a> -23 xwordpress.2014-04-01.2014-07-01.xml comment_2014_4.xml &gt; no_comment_2014_4.xml<br \/>\n<\/code><\/p>\n<p> ... would result in a suitable no_comment_2014_4.xml to Import into the WordPress MySql database.  We thank <a target=_blank href='http:\/\/stackoverflow.com\/questions\/152708\/how-can-i-search-for-a-multiline-pattern-in-a-file' title='Linux awk advice'>this link<\/a> and <a target=_blank href='http:\/\/stackoverflow.com\/questions\/14473090\/find-lines-from-a-file-which-are-not-present-in-another-file' title='Link comm command advice'>this link<\/a> and <a target=_blank title='Export memory issue' href='http:\/\/stackoverflow.com\/questions\/5164930\/fatal-error-maximum-execution-time-of-30-seconds-exceeded'>this link<\/a>.<\/p>\n<p>More WordPress upgrade information tomorrow.  Thanks for <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wpupfu.jpg\" title='Click picture'>reading<\/a>.<\/p>\n<hr>\n<div id='wupt'>\n<p>Previous relevant <a target=_blank title='WordPress Upgrade Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-upgrade-primer-tutorial\/'>WordPress Upgrade Primer Tutorial<\/a> is shown below.<\/p>\n<\/div>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wpup.jpg\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"WordPress Upgrade Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wpup.jpg\" title=\"WordPress Upgrade Primer Tutorial\"   \/><\/a><p class=\"wp-caption-text\">WordPress Upgrade Primer Tutorial<\/p><\/div>\n<p>It's early days, and there is more to be done, but here at this WordPress blog we're transitioning to version 4.1.1 from 3.0.3<\/p>\n<p>Three major decisions involved ...<\/p>\n<ol>\n<li>Do I keep the same theme?\n<ul>\n<li>This one depends a bit, and we feel the answer stems from how you go piecing together on a local MAMP web server, for the MacBook Pro example, and how long you think it would take to transition in a change of theme.  With this upgrade we tinkered with themes Twenty Fourteen, Twenty Thirteen and Twenty Fifteen with degrading success, and plumped instead to reinstall our previous theme Twenty Ten.  Think it was a good decision, as if you are sticking with WordPress default themes, Twenty Ten is still a good theme in my opinion.  Of course, you may have your own theme you like in mind and then you should invest the hours it will take to transition all the styling changes inherent in a shift of theme.<\/li>\n<\/ul>\n<\/li>\n<li>Do I change the permalink arrangement?<\/li>\n<ul>\n<li>In our previous WordPress blog we were using the default \"?p=[postId]\" arrangement which the search engines do not like ... and you can understand why, in that to glean the best categorization of a webpage's content gist, the search engines have to parse the whole page, whereas a permalink arrangement such as ...<br \/>\n<code><br \/>\n\/%postname%\/<br \/>\n<\/code><br \/>\nteamed up with a meaningful title, can tell a search engine so much about the webpage content just from its URL.  So we went ahead and tried for the best option we'd read about, as above, and it all worked well at MAMP but getting to the live server we needed the great advice of <a target=_blank title='Useful link' href='http:\/\/codex.wordpress.org\/Using_Permalinks'>this link<\/a> from a WordPress forum, and it panned out for us that the WordPress install was doing everything right as far as its \".htaccess\" file was concerned, but in our \"httpd.conf\" Apache configuration file we needed to specify ...<br \/>\n<code><br \/>\n&lt;Directory [path to new WordPress document root directory]&gt;<br \/>\n    # ... other directives...<br \/>\n    AllowOverride All<br \/>\n &lt;\/Directory&gt;<br \/>\n<\/code><br \/>\nto make things better<\/li>\n<\/ul>\n<li>Do I filter comments more?\n<ul>\n<li>Definitely that would be good, and the great choice is between the Akismet plugin and Captcha option, or both, and as we suspected, we think more people like Akismet here, and I've always liked it more too, because Captcha excludes some users from ever accessing your blog.  Akismet was already installed with WordPress, and activation for a personal blog like this one just involves getting an API_KEY from Akismet ... so thanks a lot.\n<\/li>\n<\/ol>\n<p>As you may imagine, this is an ongoing story, with more twists and turns to come.  Hope you'll join us for more information into the future, and hope to see you back at the new blog soon.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d14327' onclick='var dv=document.getElementById(\"d14327\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=wordpress\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d14327' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d14351' onclick='var dv=document.getElementById(\"d14351\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=database\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d14351' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d14410' onclick='var dv=document.getElementById(\"d14410\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=curl\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d14410' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d14468' onclick='var dv=document.getElementById(\"d14468\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=mysql\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d14468' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d50296' onclick='var dv=document.getElementById(\"d50296\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/join\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d50296' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d50312' onclick='var dv=document.getElementById(\"d50312\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/dml\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d50312' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Did you already know or did research off WordPress MySql Database Backup Tutorial&#8216;s DML link regarding &#8230; DML (Data Manipulation Language) with its 4 6-letter &#8220;verbs&#8221; &#8230; SELECT INSERT DELETE UPDATE &#8230; the usual SQL statement verbs behind the scenes &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-mysql-database-backup-update-tutorial\/\">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":{"footnotes":""},"categories":[9,12,14,37],"tags":[3418,125,128,3419,151,299,304,327,1576,3417,407,468,3416,2937,659,827,970,972,997,1044,1186,1238,1265,1319,1341,3368,1418,1456],"class_list":["post-50312","post","type-post","status-publish","format-standard","hentry","category-database","category-elearning","category-event-driven-programming","category-tutorials","tag-admin","tag-backend","tag-backup","tag-big-data","tag-blog","tag-database-2","tag-ddl","tag-did-you-know","tag-dml","tag-dump","tag-export","tag-frontend","tag-hpmyadmin","tag-insert","tag-join","tag-mysql","tag-post","tag-posting","tag-programming","tag-relational-database","tag-sql","tag-table","tag-textwrangler","tag-tutorial","tag-update","tag-version","tag-webpage","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/50312"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=50312"}],"version-history":[{"count":8,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/50312\/revisions"}],"predecessor-version":[{"id":50322,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/50312\/revisions\/50322"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=50312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=50312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=50312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}