wp-multi-network icon indicating copy to clipboard operation
wp-multi-network copied to clipboard

Existing site as root site for a new network

Open geminorum opened this issue 8 years ago • 4 comments

Apparently there's no way to use an already active site as root site of a new network. Suggesting a dropdown of available sites on new network page.

geminorum avatar Feb 21 '17 00:02 geminorum

I've wanted to build this for a while now, so maybe it's time.

JJJ avatar May 11 '18 21:05 JJJ

I need to build this same feature for another project, so I'm happy to help out. As far as I can tell, what needs to be done is:

  1. Add new entry to wp_site for the new network

  2. Switch the network ID of the existing site to the new network ID, in wp_blogs

  3. Add the following extra fields to wp_sitemeta. (Did I miss any?)

site_name admin_email admin_user_id registration upload_filetypes blog_upload_space fileupload_maxk site_admins allowedthemes illegal_names wpmu_upgrade_site welcome_email first_post siteurl add_new_users upload_space_check_disabled subdomain_install global_terms_enabled ms_files_rewriting initial_db_version active_sitewide_plugins WPLANG _site_transient_timeout_theme_roots _site_transient_theme_roots _site_transient_update_core _site_transient_update_themes _site_transient_update_plugins user_count blog_count can_compress_scripts recently_activated registrationnotification welcome_user_email menu_items first_page first_comment first_comment_url first_comment_author limited_email_domains banned_email_domains new_admin_email first_comment_email

carlomanf avatar Nov 29 '18 06:11 carlomanf

Another thought. There should maybe be an entry added to the options table for that site, indicating which network the site was previously part of, for reference purposes. Probably not the plugin doing this itself, but at least providing an action hook enabling a developer to do this if they wish.

carlomanf avatar Dec 07 '18 04:12 carlomanf

I managed to work around this issue by creating the network with the already existing site's domain, then switching the already existing site to said network and deleting it there, and removing it from the network afterwards (the site does not get deleted, but all the duplicate references are - it is a nasty workaround since the site still "spams" the "available sites" pool tho.)

MLutt avatar Dec 28 '19 00:12 MLutt