Support » Networking WordPress » Duplicating network site for staging purposes

  • Carmdq

    (@carmdq)



    Hi,

    I have a multisite installation live, that I’d like to clone entirely (root and subsites) into the same server to create a staging copy. That way I can preview contents and themes before going live. I’d like to do this manually as I don’t intend to pay for a plugin to do this.

    Initially, I’d copy the database and WP content folders and import it into a newly installed WP, updating the URLS in the database from “server.com” to something like “server.com/staging”.

    However, I’ve never attempted this before and it seems to be more complicated than that. If anyone can advise on how to do this avoiding any potential problems, I’d really appreciate it. All the procedures I’ve found online are from many years ago.

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • bemdesign

    (@bemdesign)

    It sounds like you have the theoretical process down right! The biggest pitfalls to watch out for are domain mappings (subsites) and serialized strings in the DB. You may want to take a look at how the Duplicator plugin approaches updating serialized strings in the DB.

    Anyway, since you’re just migrating things to a new location for a staging environment and not overwriting anything, there should be no harm in giving it a shot and learning something in the process! Good luck!

    Carmdq

    (@carmdq)

    Thanks. Apparently you need to the pro version of Duplicator for a multisite installation.

    bemdesign

    (@bemdesign)

    I was expecting that you would do your own database dump and file migration yourself (no plugin). I was only recommending taking a look at Duplicator plugin’s code on how they handled updating serialized strings in the database.

    So, I managed to clone to the multisite to a subdomain, firstly creating the subdomain itself, uploading a copy of the entire WP folders and then creating a new DB and importing the table from the old one. Later, within the new DB I searched and replaced all of the old url instances with the new subdomain.

    The site loads incorrectly though, as it appears not to be loading the CSS from its child theme, and not loading the images either. Pages text contents load just fine. However, the custom posts aren’t loading and I’m getting a 404 error page when trying to access one. I’ve updated the permalinks but I’m not sure where else to go from there.

    Any thoughts?

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.