Copying a Multisite to Localhost

I need to to create an staging version of my (subdomain based) multisite locally so I can make changes and test plugins and avoid taking down the whole business if I make a mistake.
As i know this is not one of those simple things and there's no an exactly "easy" way to do this, can you point me in the right direction?

Thanks in advance

  • Vaughan
    • Support/SLS MockingJay

    Hi Roberto,

    Depending on how many subsites you have, it could take you a while using snapshot to create a backup & then restore onto your local multisite. But snapshot can certainly do this for you.

    https://premium.wpmudev.org/project/snapshot/

    an alternative is to try WP migrate DB Pro https://deliciousbrains.com/wp-migrate-db-pro/

    The other way, which is the manual way of doing it.

    Using phpmyadmin in your CPanel, select your database, then choose the export option at top, select all the tables, and then it should create a dump of the DB which you can doanload, once done, you would then import this into the DB on your local install.

    Then copy all the files from your live install to the local install, you will need to edit wp-config.php to match your local installs DB credentials etc & htaccess.

    Then you can use a plugin such as search & replace to edit the DB entreies and search for your domain and replacing it with localhost instead. http://wordpress.org/plugins/search-and-replace/

    It's the same procedure as in the following article, except you aren't using a domain but instead changing to localhost.

    http://www.aurodigo.com/2013/12/moving-wordpress-multisite-from-live.html

    but wp migrate db pro is a really good option and worth the money for developers.

    Hope this helps

  • Roberto Briceño
    • Design Lord, Child of Thor

    Grazie Mr. Vaughan, that was a really good explanation.
    Right now I don't feel like buying a DB migration tool as I'm managing just 10 minisites that are really simple, with just one user and a couple of pages + some blog posts (think about them like a multipage landings) my DB is just 500Kb in size :smiley:
    But i want to grow with peace of mind and this is a procedure that is going to become an standard one in my workflow so is better that I understand well now that I'm small enough to make one mistake or two.
    I'll try with snapshot pro, thanks again.

  • calvinrogercanas
    • New Recruit

    Hey there @Roberto Briceño,

    Hope you're well! :slight_smile:

    Glad you choose to try our plugin ( you will not regret using snapshot :smiley: ). I will mark this thread as resolved but if you have anymore question please don't hesitate to reach us. :slight_smile:

    Best Regards,
    Calvin

  • Michael
    • The Incredible Code Injector

    This is a very good question, and a good answer: Snapshot. But how do I use snapshot then?

    1. create a snapshot of the Multisite
    2. install a local (MAMP) Wordpress (single site, standard install)
    3. install Snapshot on the local WordPress
    4. restore from the file created in point 1

    Is it that simple or am I missing something?

    Thanks for the help,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.