WordPress.org

Ready to get started?Download WordPress

Forums

NS Cloner - Site Copier
[resolved] Cloning root site when WP is in its own folder (4 posts)

  1. Hugh H.
    Member
    Posted 3 months ago #

    Hi:

    I need to clone the root site so, I made a clean WP Multisite install to test NS Cloner:
    blog_id 1 - http://wpmultisite.loc/
    blog_id 3 - http://wpmultisite.loc/es/ http://wpmultisite.loc/es/wp-admin/ (Added using WP)
    blog_id 4 - http://wpmultisite.loc/fr/ http://wpmultisite.loc/fr/app/wp-admin/ (Cloned from blog_id 1)
    blog_id 5 - http://wpmultisite.loc/it/ http://wpmultisite.loc/it/wp-admin/ (Cloned from blog_id 3)

    I've detected 2 issues:
    1. There's a path problem, I guess due WP is in its own directory. Note the app folder in blog_id 4

    2. Two extra tables from Multilingual Press plugin
    wp_4_mlp_languages
    wp_4_multilingual_linked

    I guess deleting them is enough

    No problems when duplicating a non-root site. By the way, the log files are very useful

    Thanks in advance
    ========================
    OS X 10.6.8
    XAMPP 1.8.2-3, PHP 5.4.22
    WP 3.9
    /app/wp-admin/
    /app/wp-content/
    ...

    Created site http://wpmultisite.loc/fr with ID: 4
    Cloned: 11 tables!
    Copied: 3 folders and files!
    Entire cloning process took: 19.7316 seconds...
    Historical Log || Detailed Log

    Created site http://wpmultisite.loc/it with ID: 5
    Cloned: 9 tables!
    Copied: 3 folders and files!
    Entire cloning process took: 9.3603 seconds...
    Historical Log || Detailed Log

    https://wordpress.org/plugins/ns-cloner-site-copier/

  2. Never Settle
    Member
    Plugin Author

    Posted 3 months ago #

    I think issue #2 is fairly straightforward. The Cloner can't tell what other tables plugins might install at the global level and thus when cloning the root site could potentially create junk tables in clones. This is one of the reasons we originally didn't allow / support ID = 1 cloning :) We currently exclude well-known table names from other plugins like BuddyPress on root cloning, and can add those tables to the exclusion. Thank you for reporting that!!! It's the only way we know we need to add things like that (can't try every plugin out there :) )

    What can we help with on issue #1? I don't think it's going to be possible to get that to work if WP is installed in /app/ without a custom exception for that scenario. In order to automate things like the Cloner does, it's expecting standard configurations where WP is installed at the root of a TLD. It can work in other scenarios too, but can also have unpredictable results sometimes in some situations.

    As a work-around, you might be able to check your site and home URL fields and update those. Not sure if it will fix the path issue or not.
    Network Dashboard > Sites > All Sites > [hover site name] Edit > Settings [tab] >
    site url field
    home url field

    What is in those? Does that help?

  3. Hugh H.
    Member
    Posted 3 months ago #

    Issue #1
    I solved the problem modifying the siteurl field in the Options table for blog_id 4, I forgot it can be done in the settings tab as you pointed out

    I think your plugin can deal with WP installations in its own folder quite easy. When cloning the main site, discard that folder in the siteurl field. As Multisite directories are virtual, not real ones, the WP folder is only used in the main site
    Siteurl
    http://wpmultisite.loc/app
    http://wpmultisite.loc/es
    http://wpmultisite.loc/fr
    http://wpmultisite.loc/it

    Issue #2
    You face a huge problem taking into account there're so many plugins. For me, a good solution would be presenting a list with non-standard WP tables and let the users, if they know/want, select wich ones shouldn't be copied. But I understand the "Decisions, not Options" principle in WP philosophy. May be the WP team should recommend to plugin developers the use of an standard second prefix in additional tables

    Another great plugin with additional tables:
    Posts 2 Posts: p2p, p2pmeta

    Thanks for your help, I'll recommend your plugin

  4. Never Settle
    Member
    Plugin Author

    Posted 3 months ago #

    Thank you for your suggestions on issue #1 - we're rewriting the plugin to v3 and have put this in our todo list of fixes.

    Great point for #2... we're working on this also just to provide more flexibility, but I hadn't thought about it solving that particular scenario too, which it would quite nicely.

    Thanks for all your feedback!

Reply

You must log in to post.

About this Plugin

About this Topic