{"componentChunkName":"component---node-modules-gatsby-theme-blog-core-src-templates-post-query-js","path":"/restoring-wordpress-after-dsm-6-update/","result":{"data":{"site":{"siteMetadata":{"title":"one melo a day","social":[{"name":"twitter","url":"https://twitter.com/melo0187"},{"name":"github","url":"https://github.com/melo0187"}]}},"blogPost":{"__typename":"MdxBlogPost","id":"30fe04a3-f24a-5f44-958b-8df0acf146b9","excerpt":"What I did to restore my WordPress blog after the DSM 6 Update","body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"layout\": \"post\",\n  \"title\": \"DSM 6 Adventures: Restoring WordPress\",\n  \"author\": \"melo\",\n  \"date\": \"2016-04-14T09:51:00.000Z\",\n  \"categories\": [\"blogging\", \"DiskStation\", \"Technical\"],\n  \"slug\": \"restoring-wordpress-after-dsm-6-update\",\n  \"excerpt\": \"What I did to restore my WordPress blog after the DSM 6 Update\",\n  \"draft\": false,\n  \"meta_title\": \"DSM 6 Adventures: Restoring WordPress\"\n};\n\nvar makeShortcode = function makeShortcode(name) {\n  return function MDXDefaultShortcode(props) {\n    console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\");\n    return mdx(\"div\", props);\n  };\n};\n\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, [\"components\"]);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"In my previous post I described\\xA0the obstacles I encountered after updating to DSM 6. This post is supposed to be a quick summary of the steps I took to get this blog up and running again. If you have ran into WordPress issues due to the DSM 6 upgrade and hope to solve them\\xA0by following these steps, please check my \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://melo.myds.me/wordpress/explosive-dsm-6-update/\"\n  }), \"last\\xA0post\"), \" first and make sure that you actually have the same problem I described.\"), mdx(\"h2\", {\n    \"id\": \"backup-delete-install-restore\"\n  }, \"Backup, Delete, Install, Restore\"), mdx(\"p\", null, \"Well, the heading says it all, really. I wasn\\u2019t able to fix the installation after it got downgraded and altered by the DSM 6 Update. So instead I moved the entire WordPress folder to a backup location and downloaded the latest WordPress version (4.4.2 at that time). The idea was to get the required parts from the old, backed up installation and transfer them to the newly downloaded one. So the first step was to copy my \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"database connection details\"), \" from the old \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"wp-config.php\"), \" file and paste them into the wp-config.php file of my new installation. I needed only these parameters: \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"DB\", \"_\", \"NAME\"), \",\\xA0\", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"DB\", \"_\", \"USER\"), \",\\xA0\", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"DB\", \"_\", \"PASSWORD\"), \" and \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"DB\", \"_\", \"HOST\"), \". This way the new installation is able to connect to the existing database, that contains things like the posts and comments, which thankfully did not get lost or corrupted during the DSM 6 update. My next step was to grab the \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"etc\"), \" folder at the root of my backed up WordPress installation and to copy it to the new installation. It contains Synology specific things and to be honest I do not fully understand what it does, but testing showed that it did not do any harm. While I was at it, I copied the following files from the old installation\\u2019s root to the new WordPress installation\\u2019s root directory: \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \".htaccess\"), \" \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"disabled.html\"), \" \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"enabled\"), \" \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"pingbackIsOpend\"), \" \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"syno-misc.php\"), \" The .htaccess file is especially important to me and worth a note. Without it, all links to my posts just led to a 404 page. Furthermore I changed my permalink format for my posts at the end of last year, so this file also contains a nifty redirect rule that allowed me to change the permalink format without breaking old links to my posts. This tool from Yoast proved to be very helpful to achieve this: \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://yoast.com/research/permalink-helper.php\"\n  }), \"Yoast permalink helper\"), \". However, for this .htaccess file to still take effect I needed to make sure that Synology\\u2019s WebStation is using Apache as a web back end, which is now one of two options\\xA0since they introduced Nginx with DSM 6. Luckily the web back end is configurable in the Web Station UI and you can choose between Nginx or Apache. Next stop was the \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"wp-content\"), \" folder. I started with the theme by simply copying my theme folder from the old installation\\u2019s \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"wp-content/themes\"), \" path and pasting it to the new installation into the corresponding directory. Then I copy-pasted the entire \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"mu-plugins\"), \" folder from the backed up wp-content path. Finally I copy-pasted all folders from \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"wp-content/plugins\"), \". This way I got my theme the way I customized it\\xA0and all my fully configured plugins back. After all these steps I moved the new and ready to go WordPress folder to my web folder and there it was back up: My WordPress blog in all its glory!\"), mdx(\"h2\", {\n    \"id\": \"fixing-wordpress-updates\"\n  }, \"Fixing WordPress Updates\"), mdx(\"p\", null, \"There was still one problem: When accessing the WordPress dashboard and checking for updates, I was still not able to install any of them. After connecting to the DiskStation through\\xA0SSH and looking around I noticed that the permissions of the WordPress folder were wrong. I \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"changed the user and group ownership of the WordPress folder to http\"), \" with this command:\\xA0 \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"sudo chown http:http -R /volume1/web/wordpress\"), \"  Now I am able to install theme and plugin updates and to update WordPress itself all from the WordPress dashboard with the click of a button, just how I like it!\"), mdx(\"h2\", {\n    \"id\": \"lessons-learned\"\n  }, \"Lessons learned\"), mdx(\"p\", null, \"I am happy to have this blog back up and running again and definitely learned my lesson. In the future I will back up my WordPress folder and the database itself before applying any WordPress update through Synology\\u2019s Package Center or doing a DSM update.\"), mdx(\"h2\", {\n    \"id\": \"the-journey-continues\"\n  }, \"The Journey continues\"), mdx(\"p\", null, \"This post will be followed by two more, describing what I did to get Piwik and Tomcat 7 working again after the DSM 6 update, since they were also negatively affected by it. In case you too had issues with these packages when updating to DSM 6, stay tuned. It might be helpful. Did you have any other troubles with WordPress after updating DSM? Did you find other solutions to restore WordPress? What precautions do you take before installing updates to keep your blog up? Feel free to share in the comments section!\"));\n}\n;\nMDXContent.isMDXComponent = true;","slug":"/restoring-wordpress-after-dsm-6-update/","title":"DSM 6 Adventures: Restoring WordPress","tags":[],"keywords":[],"date":"April 14, 2016"},"previous":{"__typename":"MdxBlogPost","id":"8f0f5fc1-5dd6-5002-b985-3c2581046db9","excerpt":"My experience upgrading a DS214play from DSM 5.2 to 6.0","slug":"/explosive-dsm-6-update/","title":"DSM 6 Adventures: Explosive Update","date":"March 31, 2016"},"next":{"__typename":"MdxBlogPost","id":"813587e7-b54b-5e14-82e0-f7d624874c71","excerpt":"The Tomcat configurations you can lose during the DSM 6 Update","slug":"/tomcat-configs-to-backup-for-dsm6-update/","title":"DSM 6 Adventures: Restoring Tomcat","date":"May 01, 2016"}},"pageContext":{"isCreatedByStatefulCreatePages":false,"id":"30fe04a3-f24a-5f44-958b-8df0acf146b9","previousId":"8f0f5fc1-5dd6-5002-b985-3c2581046db9","nextId":"813587e7-b54b-5e14-82e0-f7d624874c71"}}}