Moving WP multisite from a directory below root to root

Hi,
I need to move my multisite from a directory below root (public_html/web/) to the root (public_html). Question: can I use Cloner to do that? Is it safe and straightforward or must I 'do' anything else to make this work? If not, are there any good (and updated!) help blogs that explain the process?

  • Ash

    Hello @Chris

    Welcome to WPMU community!

    I hope you are well today and thanks for asking the question.

    Cloner does copy a whole multisite, rather it clones a subsite within a multisite network.

    Moving a multisite is little bit tricky. Please follow the procedure:

    1. Take backup of all files, folders and the entire database.
    2. Move all files from /public_html/web/ to /public_html/ folder.
    3. Export the database from phpmyadmin
    4. Open the sql file in an editor. Use search and replace feature and replace all instance of http://old-url.com with http://new-url.com domain, that means replace old url with new url.
    5. Import the updated sql

    Hope it helps :slight_smile: Please feel free to ask more question if you have any.

    Cheers
    Ash

  • Chris

    Hi again Ashok,
    I have meanwhile fixed the issue. I don't know what, in the end, fixed it, but I-:
    - also searched and replaced for 'www.domain.com/web' to: 'domain.com'
    - changed the .htaccess file content to this:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteRule ^index\.php$ - [L]
    # add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    </IfModule>
    # END WordPress

    ... but then changed it back to this (as per the Network settings in the WP admin dashboard):
    # BEGIN WordPress Multisite rules
    RewriteEngine On
    RewriteBase /web/
    RewriteRule ^index\.php$ - [L]
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    # END WordPress Multisite rules

    And this - miraculously! - fixed my issues! I also found this article extremely helpful and followed it to the comma:
    https://premium.wpmudev.org/blog/move-multisite-new-domain/

    Thanks again.
    Chris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.