WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Switching Primary site with Subdomain (8 posts)

  1. d_random
    Member
    Posted 2 years ago #

    Here is situation that I have been trying to figure out:

    I have a primary site that I no longer want to be my primary site of my multisite. I want to make it a subdomain and make a subdomain I already have set up my primary site.

    I have tried this tutorial , but it just swapped the url for the primary and subdomain.

    How do I swap a primary site and a subdomain?

  2. dgilmour
    Member
    Posted 2 years ago #

    Use export/import to swap the contents of the sites?

  3. d_random
    Member
    Posted 2 years ago #

    I gotta swap the whole thing, plugins, etc.

  4. You could try doing it in the DB. Change wp_options and wp_posts et etc to wp_x_* Then change wp_2_ to wp_ and THEN change wp_x_ to wp_2_

    But you have to be VERY careful to only change the tables required.

  5. d_random
    Member
    Posted 2 years ago #

    Sorry for being dense Ipstenu, what do you mean wp_x_*?

  6. dgilmour
    Member
    Posted 2 years ago #

    Each blog has a unique ID number.

    Go to Network Admin / Sites, hover your mouse over any blog's title and you'll see the ID number in your status bar on the end of the link URL. It will look like <site home>/wp-admin/network/site-info.php?id=1125, where in this case 1125 is the unique ID.

    The ID number is used to identify the set of database tables for each blog. They all have names like wp_1125_posts, wp_1125_comments etc.

    Ipstenu is suggesting you first rename the database tables for the home blog, which don't have an ID number, temporarily to something else, using the x.

  7. d_random
    Member
    Posted 2 years ago #

    Thanks dgilmour!

  8. gerital
    Member
    Posted 2 years ago #

    Thanks, that worked out!

    I also had to switch the wp-content/uploads directory with the blogs.dir/X/files directory and the references in the posts.

Topic Closed

This topic has been closed to new replies.

About this Topic