How to move wordpress singnal site to wordpress multisite

To move a normal wordpress site to a subpage in a multisite network, you can do the following steps. Suppose you want to convert B.com to B.domain.com in domain.com multisite network, perform the following steps

01.

Tạo trang con B.domain.com trên mạng netword

Access Các trang web của tôi > Netword admin > Trang web > Thêm mới. For example, if you have added B.domain.com, in the list of child sites, click on chỉnh sửa B.domain.com, then in the address bar of the browser will appear the ID of the subpage as wp-admin/network/site-info.php?id=7. b.domain.com will have an ID of 7, remember.

02.

Di chuyển nội dung hình ảnh từ singnal site vào trang con

Copy the Theme, Plugin active on B.com to the respective directory of the multi-page network (domain.com).

Particularly, the image folder on domain.com is slightly different, as follows.

On site B.com, Copy all files, subdirectories of wp-content/uploads/ to /wp-content/uploads/site/7/

Directory number 7 is the ID of b.domain.com.

Compress the folder to copy

If the same vps, execute the following command:

cp -av /var/www/B.com/htdocs/wp-content/uploads/* /var/www/domain.com/htdocs/wp-content/uploads/sites/7/

If other than vps, remove the necessary files and folders to reduce the size then compress again

cd  /var/www/B.com/htdocs/wp-content/uploads/
tar -zcvf uploads-7.tar.gz *

Part site B.com: /var/www/B.com/htdocs/wp-content/uploads/

Part multisite domain.com: /var/www/domain.com/htdocs/wp-content/uploads/sites/7/

Copy the zipped folder into multisite, unzip

cd /var/www/domain.com/htdocs/wp-content/uploads/sites/7/
wget https://b.com/wp-content/uploads/uploads-7.tar.gz
tar -xvf plugins-7.tar.gz
03.

Xuất database của singnal site

Access the database of the B.com site, export the database which does not include the wp_usermeta and wp_user tables. See picture below.

Export SQL data for website migration to a multipage network

Save the file to your computer and give it a name like: move-data.sql

04.

Sửa database trước khi Import

Open the move-data.sql file just saved above with a text editor, for example, Sublime text, Notepad ++ or Notepad…

Tìm và thay thế

Thay thế url website

Tìm https://B.com và thay thế tất cả bằng https://b.domain.com

Thay thế wp_ với ID trang con

Tìm `wp_ và thay thế tất cả bằng `wp_7_
(số 7 là ID trang con tương ứng như đã nói ở trên)

Lưu lại

Lưu lại file move-data.sql vừa chỉnh sửa

05.

Import database vào mạng Multisite

  1. Backup data before performing the next steps (risk prevention).
  2. In the database of the multisite network (domain.com), find and delete the database tables of B.domain.com, specifically in this article, find and delete wp_7_
  3. Import the corrected move-data.sql file into the multisite network database. Successful import will reappear the database table wp_7_

Now visit b.domain.com again to see what happens. You can see that the logo and Main menu may not be correct, you just need to go to the theme manager and fix it. Most importantly, the correct images and content are displayed.

06.

Chạy domain riêng cho trang con trong mạng

Subpages in multile networks often have domains in the form of subdomains or subfolder domains. And currently wordpress supports mapping domain without plugin. s in this article, using B.com instead of b.domain.com we do the following (the ssh section applies to webinoly, with other servers there will be their own way to map domain):

Replace the sub domain with its own domain
  1. Point the B.com domain to the ip of the server b.domain.com
  2. Visit: My websites> Netword admin> Website
  3. Edit b.domain.com
  4. Replace b.domain.com to B.com in the URL field and save your changes. (see picture)
  5. Access ssh to mapdomain and create ssl, see command below
sudo site b.com -parked=domain.com
sudo site b.com -ssl=on -root=domain.com

Now you can manage websites on your multisite network easily.

We will be happy to hear your thoughts

Leave a reply

DATVNN.COM
Logo
Search
Generic filters
Exact matches only
Register New Account
Reset Password
Shopping cart