Copy site from one multisite to another
Copy site from one multisite to another
Copy site from one multisite to another
No, not without major refactoring and lots of custom rewrite rules. The thing just isn’t geared to do that without some restructuring. Is it possible? Sure. Would it be clean and easy? Not even a little bit.
every subdomain has it’s own directory on the server when it’s created, so for example, if in the cPanel I set the mysite.example.com as a subdomain, the relative directory will be created in the root of the server, with the name of mysite.example.com. I’ve read that the subdomains must point to the main wordpress installation … Read more
I worked through this problem myself with the help of a forum mod on wordpress.org. You can see the full forum post here.
Instead of get_site_url(), use get_home_url(). This will return the URL of the site you’re in. You can also get the URL of a different site in your Multisite network by passing that site’s blog_id (ie, $url = get_home_url( 2 );). (I suspect that get_site_url() is a holdover from the early days of Multisite; when Multisite … Read more
Normally BackupBuddy should transfer users just fine, it might be issue with importing into multisite installation. Have you tried asking developers about it? As for more hands-on approach I’d try creating users in network and then overwrite hashes of their passwords in database with values from original installation.
Yes the issue is due to the auto increment setting. All WordPress DB specifics can be found here, which includes details on which ones use auto increment: https://codex.wordpress.org/Database_Description This isn’t going to be an easy task, but here’s some sites to help you: https://www.photographerstechsupport.com/tutorials/fixing-wordpress-indexes-foreign-keys-and-auto_increment-fields/ This one is specific to wp_options: https://guides.wp-bullet.com/fixing-wp_options-table-missing-unique-column-primary-key/ Specifically the auto increment: … Read more
You could check if the constant SITE_ID_CURRENT_SITE matches get_current_site()->id. The following does this for the activation. During runtime you have to check it again. register_activation_hook( __FILE__, ‘force_main_site_installation’ ); function force_main_site_installation() { if ( defined( ‘SITE_ID_CURRENT_SITE’ ) and SITE_ID_CURRENT_SITE !== get_current_site()->id ) { if ( function_exists(‘deactivate_plugins’) ) { deactivate_plugins( __FILE__ ); } die( ‘Install this plugin … Read more
I think the best way to do it is to index all the posts and search through them in database. This method should be the fastest when you perform a search because you can filter posts, create the pagination etc. Check this tutorial https://rudrastyh.com/wordpress/search-across-wp-multisite.html Another way is to to something with switch_to_blog() function – I … Read more
is_user_logged_in() is a pluggable function, which means you can override its functionality. That’s probably where I’d start. Something like this may do what you’re looking for. This is untested code and comes with no warranties of any kind. function is_user_logged_in() { $user = wp_get_current_user(); $current_blog_id = get_current_blog_id(); $allowed = false; $blogs_of_user = get_blogs_of_user( $user->ID ); … Read more