Title: Move WordPress install
Last modified: March 21, 2021

---

# Move WordPress install

 *  [grey4radar](https://wordpress.org/support/users/grey4radar/)
 * (@grey4radar)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/move-wordpress-install-2/)
 * I have a live WordPress site installed at WordPress Address – **mydomain.com/
   WEBSITE** and Site Address – **mydomain.com**.
    I am developing a new site at
   WordPress Address – **mydomain.com/NEW**.
 * When it is time to make the development site live, am I correct in thinking that
   I can do the following:
    1. Rename the current live site directory to **OLD** or delete it.
    2. Log in to the development WordPress dashboard > Settings and change WordPress
       Address form **mydomain.com/NEW** to **mydomain.com/WEBSITE** and also change
       Site Address to **mydomain.com** then log out.
    3. Copy the .htaccess from **mydomain.com/NEW/** into domain root directory.
    4. Log in to what should now be the only working WordPress site.
    5. Change the Permalinks to something different and save the changes.
    6. Change the Permalinks to my preferred structure and save the changes.
 * Any thoughts would be appreciated.
    -  This topic was modified 5 years, 2 months ago by [grey4radar](https://wordpress.org/support/users/grey4radar/).
    -  This topic was modified 5 years, 2 months ago by [grey4radar](https://wordpress.org/support/users/grey4radar/).

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/move-wordpress-install-2/#post-14214345)
 * No.
    1. Log in to the development WP and use a plugin like Search Regex to change`
   href="mydomain.com/NEW"` to `href="mydomain.com`. Keep the images as is, which
   would be `src="mydomain.com/NEW` followed by the path to wp-content. 2. Go to
   Settings > General and change the SiteURL to **mydomain.com**. 3. Save Permalinks
   to regenerate .htaccess and rewrite rules 4. Copy .htaccess to domain root with
   the caveat that the old one might have redirects or other special handling that
   you or a plugin added. If so, copy the special stuff to the new one. 5. Edit 
   index.php in domain root and change WEBSITE to NEW. 6. Do whatever you want with
   the old WEBSITE folder and database.
 * If you didn’t duplicate the content folder or you want the URLs to images to 
   be like before (with WEBSITE), it would be a little different, but your method
   does not address the image paths at all.
 *  Thread Starter [grey4radar](https://wordpress.org/support/users/grey4radar/)
 * (@grey4radar)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/move-wordpress-install-2/#post-14214646)
 * Hi Joy,
 * Thanks for your reply.
 * Wouldn’t your solution mean that the WP url would be **mydomain.com/NEW** and
   the SITE url **mydomain.com**?
 * I may have omitted to say that what I am looking for, is that when the dev site(
   NEW) goes live I would like the WP url to be **mydomain.com/WEBSITE** and the
   SITE url **mydomain.com** and the old (WEBSITE) renamed or deleted.
    Surely that
   would solve the image URLs issue also.
 * Thankfully the site rollout is a few weeks away so no rush for a resolution on
   this.
    I’m waiting to here from my SEO people on whether they would prefer to
   keep the original image URLs.
 * I didn’t duplicated the content folder (some new images, different theme, different
   menu and plugins etc).
    Nothing fancy in the .htaccess (I will manually add any
   301 page redirects if required).
 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/move-wordpress-install-2/#post-14214923)
 * OK, it was difficult to determine whether the WP folder name mattered. In your
   scenario, you were using WEBSITE but there wasn’t one any more.
    I forgot to 
   mention that if the site has posts, the guid in the posts table is used for RSS
   readers to know if the post has been seen before, so that could be affected by
   building it at /NEW. Those should be changed to remove /NEW. Pages aren’t part
   of the feed.
 * 1. Log in to the development WP and use a plugin like Search Regex to change `
   href="mydomain.com/NEW"` to `href="mydomain.com`. Change the images from `src
   ="mydomain.com/NEW` to `src="mydomain.com/WEBSITE"`.
    2. Go to Settings > General
   and change the SiteURL to **mydomain.com** and WordPressURL to **mydomain.con/
   WEBSITE**. 3. Rename WEBSITE folder to OLD. 4. Rename NEW folder to WEBSITE. 
   5. Log in and save Permalinks to regenerate .htaccess and rewrite rules. 6. Do
   whatever with OLD folder and database.
 *  Thread Starter [grey4radar](https://wordpress.org/support/users/grey4radar/)
 * (@grey4radar)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/move-wordpress-install-2/#post-14224307)
 * If I do search regex in search only mode for `href="mydomain.com/NEW"` and `src
   ="mydomain.com/NEW` I get “**No more matching results found.**“
 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/move-wordpress-install-2/#post-14224487)
 * That’s good. It indicates you already changed them, or you never had any internal
   references in your content (although you said you had some images). Hopefully,
   you used the full URL, starting with http, when you searched.
 *  Thread Starter [grey4radar](https://wordpress.org/support/users/grey4radar/)
 * (@grey4radar)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/move-wordpress-install-2/#post-14224589)
 * I didn’t do anything!
    I only used search mode, not search and replace.
 *  Thread Starter [grey4radar](https://wordpress.org/support/users/grey4radar/)
 * (@grey4radar)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/move-wordpress-install-2/#post-14225292)
 * I tried a different approach which seems to have worked.
    1. Log out of all WP dashboards.
    2. In cpanel file manager, rename the original `WEBSITE` to `RANDOM-NAME` or delete
       it.
    3. In phpMyAdmin select the database for `NEW` and select “wp_options” table and
       change “siteurl” and “home” to `mydomain.com/WEBSITE`.
    4. In cpanel file manager, rename `NEW` to `WEBSITE`.
    5. In cpanel file manager, edit “.htaccess” in the newly renamed `WEBSITE` folder
       and change `RewriteRule . /NEW/index.php [L]` to `RewriteRule . /WEBSITE/index.
       php [L]`
    6. Go to mydomain.com/WEBSITE/wp-admin and login with credentials for `NEW`.
 * Then do the move WP from directory to root – [https://www.webhostinghub.com/help/learn/wordpress/running-wordpress-from-a-subdomain-or-subdirectory](https://www.webhostinghub.com/help/learn/wordpress/running-wordpress-from-a-subdomain-or-subdirectory)
 * Voila – I now have the NEW WordPress site in a folder named WEBSITE viewable 
   from mydomain.com
 * The only downside was that there were more than 30 references to `NEW` still 
   in the database.
 * I’m not an SQL guru so it took me around an hour to manually edit all those out
   in phpMyAdmin.
 * There are only 5 pages/posts on the development site for now but the final site
   will have nearly 50 pages/posts. That’s a long time to spend in phpMyAdmin manually
   editing.
 * One other issue was with a photo slider plugin that I had to reset.
    -  This reply was modified 5 years, 2 months ago by [grey4radar](https://wordpress.org/support/users/grey4radar/).

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Move WordPress install’ is closed to new replies.

## Tags

 * [move](https://wordpress.org/support/topic-tag/move/)

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 7 replies
 * 2 participants
 * Last reply from: [grey4radar](https://wordpress.org/support/users/grey4radar/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/move-wordpress-install-2/#post-14225292)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
