{"id":218,"date":"2013-01-10T20:14:46","date_gmt":"2013-01-10T20:14:46","guid":{"rendered":"https:\/\/puvox.software\/?p=218"},"modified":"2021-11-14T13:45:49","modified_gmt":"2021-11-14T13:45:49","slug":"migrating-normal-wp-site-as-multisite","status":"publish","type":"post","link":"https:\/\/puvox.software\/blog\/migrating-normal-wp-site-as-multisite\/","title":{"rendered":"Migrating WP into MULTI-SITE (sub-site)"},"content":{"rendered":"<div class=\"default-content-clss content_218 type_post \"><div class=\"wpLinkHere\">Remember short-link to MUST-HAVE WP plugins: <a href=\"https:\/\/puvox.software\/wordpress\">puvox.software\/wordpress<\/a>&nbsp; <\/div><div style=\"clear:both;\"><\/div><p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-1689 size-full\" src=\"https:\/\/puvox.software\/wp-content\/uploads\/2017\/01\/into-multi.png\" alt=\"multi sub-sites\" width=\"796\" height=\"270\" \/><\/p>\n<h2 style=\"text-align: center;\">Change Single WP site into Multi-Site (MS)<\/h2>\n<p>WordPress Multisite is an excellent feature. Even if you want to use only one site, you&#8217;d better to create a MS wordpress installation, and then use the first sub-site as the MAIN SINGLE SITE. (If you dont know MS functionality fully, at first,\u00a0 I RECOMMEND YOU TO SPEND ABOUT A HALF AN HOUR to understand what it is. You can\u00a0read about it\u00a0\u00a0<a href=\"https:\/\/premium.wpmudev.org\/blog\/ultimate-guide-multisite\/\" target=\"_blank\" rel=\"noopener\">here<\/a>\u00a0)<\/p>\n<p>Then,\u00a0 you can start:<\/p>\n<h2 style=\"text-align: center;\">(Step 1) Setup the main domain<\/h2>\n<p>Let&#8217;s say, you want to setup MultiSite WordPress at\u00a0<strong><code><span class=\"codee\">example.com<\/span><\/code><\/strong>,\u00a0having like:<\/p>\n<ul>\n<li><strong><code><span class=\"codee\">example.com\/james<\/span><\/code><\/strong><\/li>\n<li><strong><code><span class=\"codee\">example.com\/elsa<\/span><\/code><\/strong><\/li>\n<li>etc&#8230;<\/li>\n<\/ul>\n<p>At first, simply enable MS feature there (read <a href=\"http:\/\/codex.wordpress.org\/Create_A_Network\" target=\"_blank\" rel=\"noopener\">this<\/a> or <a href=\"https:\/\/www.elegantthemes.com\/blog\/resources\/the-complete-guide-to-creating-a-wordpress-multisite-installation\" target=\"_blank\" rel=\"noopener\">this<\/a>).<\/p>\n<p>Now let&#8217;s say, you are migrating <strong><code><span class=\"codee\">james.de<\/span><\/code><\/strong>\u00a0<span style=\"font-size: 8pt;\">(or even\u00a0\u00a0<strong><code><span class=\"codee\">example.com<\/span><\/code><\/strong>)<\/span> into\u00a0\u00a0<strong><code><span class=\"codee\">example.com\/james<\/span><\/code><\/strong>.\u00a0 In <strong><code><span class=\"codee\">example.com<\/span><\/code><\/strong>\u00a0dashboard, create a sub-site named <code><strong>james<\/strong><\/code>. Now, remember which ID is assigned to that sub-site<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-1690 size-full\" src=\"https:\/\/puvox.software\/wp-content\/uploads\/2017\/01\/network-id.png\" alt=\"site id in network\" width=\"658\" height=\"318\" srcset=\"https:\/\/puvox.software\/blog\/wp-content\/uploads\/sites\/2\/2017\/01\/network-id.png 658w, https:\/\/puvox.software\/blog\/wp-content\/uploads\/sites\/2\/2017\/01\/network-id-300x145.png 300w, https:\/\/puvox.software\/blog\/wp-content\/uploads\/sites\/2\/2017\/01\/network-id-400x193.png 400w, https:\/\/puvox.software\/blog\/wp-content\/uploads\/sites\/2\/2017\/01\/network-id-520x251.png 520w, https:\/\/puvox.software\/blog\/wp-content\/uploads\/sites\/2\/2017\/01\/network-id-60x29.png 60w\" sizes=\"(max-width: 658px) 100vw, 658px\" \/><\/p>\n<p>Let&#8217;s say, it is <span style=\"font-size: 18pt; color: #ff0000;\"><strong>2 <span style=\"font-size: 10pt;\">(note usage of this number in the rest of this tutorial. OF COURSE, YOU SHOULD CHANGE IT WITH YOUR ACTUAL ID).<\/span><\/strong><\/span><\/p>\n<p>Continue reading&#8230;<\/p>\n<p>&nbsp;<\/p>\n<h2 style=\"text-align: center;\">(Step 2) edit SQL with phpMyAdmin<\/h2>\n<p>In most cases, I wont recommend to use the <strong>built-in Export\/Import feature<\/strong> in such cases, because you might lose IDs, permalinks and etc.. So, the best way is to migrate UNTOUCHED DB correctly.\u00a0 During the migration, we will have to\u00a0<strong>REPLACE SOME STRINGS INSIDE DATABASE<\/strong>, for which<strong> I HIGHLY RECOMMEND <\/strong><strong><a href=\"https:\/\/puvox.software\/software\/WordpressMigrator.php\" target=\"_blank\" rel=\"noopener\">Database Migrator<\/a> <\/strong>script (instead of simple TEXT-EDITORS, because\u00a0 if you&#8217;ll replace strings manually using text-editors, then SERIALIZED ARRAYS wont be re-calculated, and site wont function correctly! ).<\/p>\n<p>At first, Export database SQL file from <strong><code><span class=\"codee\">james.de<\/span><\/code><\/strong>using phpMyAdmin (Note, make 1 additional copy of that SQL for a backup). Now, in the SQL file, replace all occurrences of:<\/p>\n<ul>\n<li><strong><code>wp_user_<\/code><\/strong>\u00a0with <strong><code>w_2_user_<\/code><\/strong><\/li>\n<li><strong><code>`wp_<\/code><\/strong>\u00a0with <strong><code>`wp_<span style=\"color: #ff0000;\">2<\/span>_<\/code>\u00a0<\/strong>(\u00a0After replacement, just rename <strong><code>w_2_users<\/code><\/strong>\u00a0back to <strong><code>wp_users<\/code>\u00a0<\/strong>\u00a0[and same with\u00a0<strong><code>w_2_usermeta<\/code><\/strong>\u00a0],\u00a0 because they should stay as is )<\/li>\n<li><strong><code>wp_capabilities<\/code><\/strong>\u00a0with <strong><code>w_2_capabilities<\/code><\/strong><\/li>\n<li><code><strong><span class=\"codee\">james.de\/<\/span><\/strong><\/code> with <code><strong><span class=\"codee\">example.com\/james\/<\/span><\/strong><\/code> (also, read [popupi 1]THIS NOTICE (popup)[\/popupi]\u00a0after conversion )<\/li>\n<li><strong><code>\/uploads\/<\/code><\/strong> with <strong><code><span class=\"codee\">\/uploads\/sites\/2\/<\/span><\/code><\/strong> (note,it&#8217;s a bit tricky&#8230; After replacements, manually search for <code><span class=\"codee\"><strong>\/uploads\/<\/strong><\/span><\/code> phrase, to ensure that you havent accidentally replaced external links i.e. <code><span class=\"codee\">microsoft.com\/<strong><span style=\"color: #ff0000;\">uploads<\/span><\/strong><span style=\"color: #ff00ff;\"><b>\/sites\/2\/<\/b><\/span><\/span><\/code> )<\/li>\n<\/ul>\n<h2 style=\"text-align: center;\">(Step 3) Avoid user ID conflicts<\/h2>\n<p>Now remains most important part: <b>users<\/b>! To avoid conflict between user IDs, enter in\u00a0<code><strong><span class=\"codee\">example.com<\/span><\/strong><\/code> database: in <code>wp_users<\/code>\u00a0and <code>wp_usermeta<\/code>, replace the ADMINISTRATOR (and all other users) IDs to random number i.e. <strong>321<\/strong>\u00a0(WHICH USER ID DOESNT EXIST IN <strong><code>james.de<\/code><\/strong>&#8216;s database).<\/p>\n<h2 style=\"text-align: center;\">(Step 4) Move files<\/h2>\n<p>Now, <b>Files &amp; Folders<\/b>: move all contents from <strong><code>james.de\/wp-content\/uploads\/<\/code><\/strong>\u00a0in <strong><code>example.com\/wp-content\/uploads\/sites\/2\/<\/code><\/strong>\u00a0folder.<br \/>\nAlso, do this <a>check in Database<\/a>.<\/p>\n<h2 style=\"text-align: center;\">(Step 5) Importing DB<\/h2>\n<p>At first, delete in\u00a0<code><strong><span class=\"codee\">example.com<\/span><\/strong><\/code> database, delete all tables starting with <strong><code>w_2_<\/code><\/strong>, and now I think you are ready to import the <strong><code>james.de<\/code><\/strong>&#8216;s our modified SQL file. (During import, if there happens any SQL errors, then fix them &#8211;\u00a0 \u00a0BTW, another recommended way could be to import the tables one-by-one\u00a0 usng PHPMYADMIN&#8217;s SQL Tab, where you can copy&amp;paste contents from SQL file to be executed directly. Thus, you will see directly which table might give you import errors).<\/p>\n<h2 style=\"text-align: center;\">(Step 6) Specific notes<\/h2>\n<p>After importing, read these [popupi 3]notes (popup).[\/popupi]<\/p>\n<h2 style=\"text-align: center;\">Finished !<\/h2>\n<p><strong>If Import is successful, then visit your site! Congratulations!<\/strong><\/p>\n<p>(p.s. In addition, you can read these\u00a0[popupi 2]nice tutorials (popup)[\/popupi] too.)<\/p>\n<p style=\"text-align: right;\"><i style=\"color: gray;\">If you find issues <i>in this tutorial,\u00a0<\/i>or you want custom help of programmer, you can contact <a href=\"https:\/\/puvox.software\/contact-us\/\" target=\"_blank\" rel=\"noopener\">https:\/\/puvox.software\/contact-us\/<\/a>.<\/i><\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<div class=\"default-content-clss excerpt_218 type_post \"><p>Remember short-link to MUST-HAVE WP plugins: puvox.software\/wordpress&nbsp; Change Single WP site into Multi-Site (MS) WordPress Multisite is an excellent feature. Even if you want to use only one site, you&#8217;d<a class=\"excerpt-read-more\" href=\"https:\/\/puvox.software\/blog\/migrating-normal-wp-site-as-multisite\/\">(Continue Reading)<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":1689,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[8],"tags":[],"class_list":["post-218","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress"],"_links":{"self":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/posts\/218","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/comments?post=218"}],"version-history":[{"count":0,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/posts\/218\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/media\/1689"}],"wp:attachment":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/media?parent=218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/categories?post=218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/tags?post=218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}