Support » Networking WordPress » Migrate WP 3.0 from subdomain to another subdomain

  • Ok, here is the situation.

    I am sharing hosting with my sites. My main site is set up and hosting all my other domains. I have each of these domains pointed to a subdirectory on the main site. For example: is hosting,, etc.

    I have a domain that was pointing to which had WordPress on it. I want to shift that domain to point to, which also has WordPress installed on it but WP 3.0.1 (using the multisite functionality and buddypress).

    So, I went into my host, pointed the domain to and indeed, when you type in the domain name it redirects to

    Problem is, I don’t want my URL to reveal where I am hosting my site to visitors. I don’t want the url to say I want the URL to say

    With the old WordPress, or even the current standard install (not multisite), you would just go to Admin > Settings > General and change the URLs of the WordPress URL and Site URLs. (as per our example, I just changed it from to

    You can’t do this in WP 3.0 multisite. I am trying to figure out how. Now, when I look at the wp-config.php file I see:

    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/domainA/';
    define( 'DOMAIN_CURRENT_SITE', '' );
    define( 'PATH_CURRENT_SITE', '/domainA/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    Is that what I need to change? Just change to and domainA to domainB?

    Thanks to anyone who can help!

Viewing 15 replies - 1 through 15 (of 19 total)
  • And all the references that are saved in the database.

    Thanks Andrea, but that didn’t seem to work.

    I updated the links in the wp-config file but I am still getting the same URL:

    Maybe I didn’t mention this – I have my domain pointing to my directory. I want the URL to not state exactly where it is, but have the domain name there instead. So, instead of (as it was moved from, I want it to simply say

    I have pointed the domain to I assume that there is something I have to configure in the config file for that to change but the suggestion I made above didn’t work.

    Ok, long story short:

    Figured I would use the Super Admin > Sites > Edit function. But it wont let you change the Domain, Path, and SiteURLS.

    Are those the areas that are changed in the wp-config file?

    @ Andrea-r, you mentioned updating the references in the database. How is that done?

    You go into the databse via something like phpmyadmin and you do a search for all instances of the old URL. then you updated to the new one.

    It’s laborious.

    You can get a backup or dump of the db, edit it locally to do a sweeping search & replace, then put it back on the site.

    When you are running a network you can’t just change it in the config file, because it is stored in most of the tables in the db.

    Ahh…ok, good to know.

    So, how do you install the site then? If I create a directory and upload wordpress 3.0, how do I get the domain to reflect the directory?

    Put it another way, if I wanted to be the root, how would I point the domain to be =

    You’d install wp in the directory you want, and it’ll pick that up.

    then up in the root, you’d put in a redirect (outside of wp)

    I am still not finding the solution. But let me be specific here, what the heck.

    I want domain to point to the sub-directory I have my domain pointed towards that directory with my host, no problem. But when I navigate to my site, it still shows the url, etc. I want that to change to…

    So, here is what I have done so far.

    1. I have updated my config file from:

    $base = '/marlinsnation-site/';
    define( 'DOMAIN_CURRENT_SITE', '' );
    define( 'PATH_CURRENT_SITE', '/marlinsnation-site/' );


    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', '' );
    define( 'PATH_CURRENT_SITE', '/' );

    2. I changed my htaccess from

    RewriteBase /marlinsnation-site/


    RewriteBase /

    3. I went into my db, using phpmyadmin, and updated the following fields on the table wp-options:





    (… = http://) I got a database error.

    Ok, I hope someone spots something really obvious because, for the life of me, I can’t figure this one out. Driving me MaDD ;D

    re #3 – there’s more tables. I’d list them, but… there’s a lot. Like
    for starters.

    Thanks Andrea.

    I create a data dump from my tables, copied and pasted to Notepad. Then used the search function to find the old URL and replaced it with the new URL. You’re right, it was laborious, especially on a site that extends back a few years with content, but using that technique was efficient.

    Now, here is a really dumb question. How do I save that work as an .sql so I can import it back into my database? And, do I just import it or do I have to drop the tables first then import it?

    After this, I will make the edits mentioned above to my config and .htaccess files. That, I hope, should do it.

    To save my revised data, I just clicked Save As in Notepad, and chose UTF-8 for the option and titled the file datafile.sql. Saved it – just hope all the characters stay!

    According to this article, they will:

    Now…how to import back into database…

    Yeah, this is the scary part – you have to drop all the tables and reimport your new sql.

    For the nervous – dump it all in a new db and switch the config to use the new db.

    dropped my previous tables, and imported new data.

    Configured my config and my htaccess files and…

    Error establishing database connection

    So, it didn’t work. I am sure I missed something but getting frustrated since this is seemingly something that isn’t all that complicated and has been done before. After all, how do people migrate their WP installs from one directory to another?

    You win, for now, WordPress. But I’ll be back someday!

    In all seriousness, I have a production site and can’t afford to mess around with it. I will try this out on an experimental site and see exactly how you migrate WP 3.0.1 MS from one sub-directory to another and point that domain there.

    If I can’t figure it out, I am sure someone else will!

    Thanks for your help. Andrea. Sorry I am too stoopid to figure out how to fix this!

    Configured my config and my htaccess files and…

    Error establishing database connection

    Could been a typo. 🙂 Been there.

    Check your wp_blogs table and check the domain names for your blogs… it seems that wp looks for a “available” blog, and if not, it raises that database connection error 🙂

    I had the same issue just now.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Migrate WP 3.0 from subdomain to another subdomain’ is closed to new replies.