• Resolved elthomas

    (@elthomas)


    Hello,

    first of all, thank you for this pluning very useful and efficient!

    I have a question about the “the Target site / URL” field.
    To host the sites of my clients, I use WordPress multisite with subdomains configuration. But in fact, each site has its own domain (www.mainsite.com, http://www.client1.com, http://www.client2.com etc…).

    In the setup page of the plugin, the domain is hardcodded and can’t be modified. Only the subdomain can be written in the field in front of the domain.
    For the moment, to clone my template site:

    • I need to enter first a temporary URL (subdomain of my main site)
    • I clone the site
    • I must go the site settings to modify its URL and change it by the final one.

    My problem is that with the process described above, all the replacement were done with the temporary URL. I means that after modifying the site URL to put the final one, all the links to images etc.. are broken.

    I think modifying the plugin to:

    • remove the verification of the URL
    • remove the main domain hardcoded

    Do you think it is feasible? Will the clone process work if I force directly another domain that the main domain of the network?

    Thanks in advance,
    Thomas

    • This topic was modified 9 years, 4 months ago by elthomas.
    • This topic was modified 9 years, 4 months ago by elthomas.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Never Settle

    (@neversettle)

    It sounds like you are using something like domain mapping. Is that correct? If not – if you are doing something more manual, then I highly recommend using a domain mapping plugin to accomplish the same thing in a much more manageable way.

    Even though you are using unique domains for each subsite, wordpress still stores everything relative to the unique subsite name of the new site created. For example, if you go through the normal site creation process in Network Admin, you see the exact same thing: you provide the “site name” which is a subdomain of the main root site.

    Domain mapping inherently translates those URLs from the subsite URL to the unique URL.

    By the way, you should never be using static hard-coded links in your content or URLs for any domain – all links should be relative URLs so that regardless of the final domain name, they will always work.

    For using the Cloner in a domain mapping scenario – the process is the same, but the site that you clone / copy should NOT have domain mapping active or configured. It should be something like template.domain.com – a generic subsite.

    Once cloning is complete, all you have to do then is configure the domain mapping settings on the clone site to be whatever domain you want it. WordPress manages the rest.

    Does that help?

    The things you are asking for would actually break the way WordPress multisite works. Those verifications / domain name are not hard-coded – they are pulled from WordPress itself based on the actual installation. Without using those values, the new site creation would fail because WordPress multisite would treat it as an invalid subsite request. Does that make sense?

    Cheers!

    Thread Starter elthomas

    (@elthomas)

    Hello,

    thank you for the detailed answer. It makes sense and it helps!

    Yes, I use domain mapping, it is correct. I don’t use a domain mapping plugging because now, this functionality is a native feature in WordPress (codex.wordpress.org/WordPress_Multisite_Domain_Mapping).

    I use relative URL in the content of the posts/pages of my template site (the one I need to clone). However, in the theme customizer, relative URLs can’t be used (for example, to select the header image of the theme, I can only select an image in the theme customizer but I can’t modify the URL => it’s not possible to use relative URL here). It is this second point that creates broken url in my “cloning” process.

    I understand as well that the plugin can create only subdomain website, since WordPress as well doesn’t allow to create directly a website with a different domain. And I understand that modifying that isn’t a good idea 😉
    By default, the process to create a website with domain mapping in WordPress is:

    1. Create a subdomain website
    2. Change the Site Address to put the final domain

    If the new site is still empty at point 2 (no theme customization), changing the Site Address doesn’t broke anything.

    My problem is that my template site has its theme customzed and then, uses absolute URL.

    However, I have thought to a solution to avoid broken links in the theme customization data of my template site.
    I will simply go in the database to edit there the theme customization saved data and change absolute URL by relative URL. And that’s it! I will have a a template site without absolute URL, cleaned to be cloned 🙂

    Cheers!

    Plugin Author Never Settle

    (@neversettle)

    Ah – now I understand better about the Theme settings! Yes, that is a bit of a challenge. It sounds like there are not a lot of settings, and you have figured out a work-around. I’m sorry that it is 1 extra step, but hopefully still many less steps without the Cloner at all 🙂

    If you find there are several of those replacements, you might find it useful to do those in one pass with something like the Better Search Replace plugin our the Pro version of our Cloner (which has a Search Replace tool which could do that for you during the clone itself.

    Best!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Clone a site with another URL’ is closed to new replies.