Title: Migrating to same domain
Last modified: August 31, 2016

---

# Migrating to same domain

 *  Resolved [patbell101](https://wordpress.org/support/users/patbell101/)
 * (@patbell101)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/migrating-to-same-domain/)
 * I have read the codex entry for this and it seemed that keeping the same domain
   and url was the most straightforward.
 * But how do I test the new host multisite? Or do I just change the DNS entry for
   my domain, wait for a few hours and hope for the best?

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/migrating-to-same-domain/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/migrating-to-same-domain/page/2/?output_format=md)

 *  [George Notaras](https://wordpress.org/support/users/gnotaras/)
 * (@gnotaras)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/migrating-to-same-domain/#post-7121590)
 * You can always edit the `hosts` file of your operating system and set the domain
   name to resolve to the new IP. This implies that you have already copied the 
   files and the database to the new provider.
 *  Thread Starter [patbell101](https://wordpress.org/support/users/patbell101/)
 * (@patbell101)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/migrating-to-same-domain/#post-7121839)
 * I have edited my hosts file and patbell.co.uk/wp-admin now generates a 404 error.
   I have installed WP via the cpanel on my new host and I can see it in filezilla.
   I also apparently have a mysql databases with a user created in wp-users.
 * I presume you meant just xxx.xxx.xxx.xxx mydomain in hosts?
 *  [George Notaras](https://wordpress.org/support/users/gnotaras/)
 * (@gnotaras)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/migrating-to-same-domain/#post-7121841)
 * Hi,
 * I think I should have clarified it a little better. I meant the `hosts` file 
   on your desktop, so that the web browser resolves your domain to the new IP so
   that you can check the web site on the new provider.
 * George
 *  Thread Starter [patbell101](https://wordpress.org/support/users/patbell101/)
 * (@patbell101)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/migrating-to-same-domain/#post-7121842)
 * Yes I understood that; and its what I did. But I am just trying to setup a startup
   wp system and can’t
 *  Thread Starter [patbell101](https://wordpress.org/support/users/patbell101/)
 * (@patbell101)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/migrating-to-same-domain/#post-7121850)
 * so, having set the ip address for my domain in hosts (on my local machine). What
   now? I have installed wp via the new hosts funtionality but what do I need to
   do to the wp configuration to access? I presume something needs to be done since
   I get a 404 message when trying to access wp-admin.
 *  [George Notaras](https://wordpress.org/support/users/gnotaras/)
 * (@gnotaras)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/migrating-to-same-domain/#post-7121851)
 * Hi [@patbell101](https://wordpress.org/support/users/patbell101/)
 * I thought your goal was to transfer the wordpress installation to another provider.
   What I suggested above was to edit your desktop’s hosts file and point your domains
   to the IP of the new provider after you had transfered the files and the database,
   so you could do a simple test if everything was fine without changing your DNS
   zone.
 * It turns out that your use case scenario is a little bit more complicated than
   what I had initially thought and I’m afraid that it’s a little difficult for 
   me to understand the details of your environment through this thread.
 * So, I will kindly retire from it as I think I cannot provide much help about 
   this issue as I have probably misunderstood the goal you are after.
 * BTW, if you are trying to test your web site locally, I’d highly recommend starting
   a new topic in the ‘Localhost’ forum.
 * Kind Regards,
    George
 *  [George Notaras](https://wordpress.org/support/users/gnotaras/)
 * (@gnotaras)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/migrating-to-same-domain/#post-7121852)
 * Also, I just pointed a live domain to 127.0.0.1 through my desktop’s hosts file,
   set up a virtual host in XAMPP’s apache server and installed wordpress.
 * My browser can access the locally installed version of the web site (currently
   empty) instead of the one that is live on the internet. Accessing the admin interface
   works as expected as well.
 * So I’d assume that there is something done wrong on your end or the use case 
   scenario is more complicated than it is described through these posts.
 * In any case I’d suggest to also ask in the Localhost forum.
 * I’m sorry for not being able to help you more with this.
 * George
 *  Thread Starter [patbell101](https://wordpress.org/support/users/patbell101/)
 * (@patbell101)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/migrating-to-same-domain/#post-7121853)
 * George, that is my scenario, ie trensferring my domain to a new server and I 
   was trying to test the process at an earlier stage. I will extract my backups(
   files and database) and proceed as you expected me to.
 *  [George Notaras](https://wordpress.org/support/users/gnotaras/)
 * (@gnotaras)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/migrating-to-same-domain/#post-7121854)
 * Hi Pat,
 * Here is some more info about the procedure.
 * As a first thing I’d make sure that all the domains you are going to test as 
   part of the network installation point to 127.0.0.1, including the ‘www’ versions,
   eg:
 *     ```
       127.0.0.1    example.com
       127.0.0.1    www.example.com
       127.0.0.1    demo.example.com
       127.0.0.1    www.demo.example.com
       127.0.0.1    example.net
       127.0.0.1    www.example.net
       ```
   
 * Secondly, I’d add a virtual host in XAMPP’s apache making sure that all the domains
   that are going to be served by it exist in `ServerName` *or* `ServerAlias` directives.
 * Then, I’d transfer the files in the DocumentRoot of that virtual host exactly
   as they are arranged on the live server.
 * Finally, I’d locally create a database (using the same name as the one on the
   live server) in phpMyAdmin and import the data to it.
 * After restarting apache, the web sites should be accessible locally without making
   any requests to the live server.
 *  [George Notaras](https://wordpress.org/support/users/gnotaras/)
 * (@gnotaras)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/migrating-to-same-domain/#post-7121855)
 * Now that it is clear what your goal is, please feel free to ask any questions(
   if any). 🙂
 *  [George Notaras](https://wordpress.org/support/users/gnotaras/)
 * (@gnotaras)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/migrating-to-same-domain/#post-7121856)
 * Forgot to mention that `wp-config.php` should be edited and you should make sure
   the database name is correct, the DB_USER is set to `root` (unless you have set
   up users differently in your local MySQL server) and DB_PASSWORD is empty (`''`).
 * Also, any security related rules in htaccess should be double checked so that
   they interfere.
 * George
 *  [George Notaras](https://wordpress.org/support/users/gnotaras/)
 * (@gnotaras)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/migrating-to-same-domain/#post-7121857)
 * Also, I think I’ve figured out a possible cause why you might be getting a `Not
   Found` error when accessing the admin interface. This issue must have to do with
   SSL.
 * If you are accessing your normal live web site over SSL or have configured it
   to access the admin area over SSL, you should either make sure your local virtual
   host is configured for access over HTTPS or edit the URLs in the database or 
   finally remove any configuration options like the following from `wp-config.php`:
 *     ```
       //define('FORCE_SSL_LOGIN', true);
       //define('FORCE_SSL_ADMIN', true);
       ```
   
 * Update for correction regarding a previous post:
 * >  Also, any security related rules in htaccess should be double checked so that
   > they interfere.
 * Meant to be ‘so that they don’t interfere.’
 *  Thread Starter [patbell101](https://wordpress.org/support/users/patbell101/)
 * (@patbell101)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/migrating-to-same-domain/#post-7121861)
 * George, I’ve got a bit confused with the localhost stuff here. So to clarify 
   the current situation.I have copied all my public_html files to my new host, 
   and restored the database, apparently successfully. I have disabled .htaccess
   and at the newly copied database has the same name and user as the old one.
 * I am trying to test my new hosting prior to changing my dns. I have changed my
   Hosts entry and now when I ping patbell.co.uk it returns 108.167.137.112 which
   fwiw is the IP address of my new host’s server. I have my root domain of patbell.
   co.uk and several subdomains of e.g. inframe.patbell.co.uk.
 * The codex just says “to test before you switch, you must temporarily change “
   siteurl” and “home” in the database table “wp_options”” but to what do I change
   them? With no changes accessing my root domain and subdomain sites just goes 
   to my old host. I have tried swapping patbell.co.uk with the new hosts ip and
   also their server name (e20) but both fail to locate anything.
 *  [George Notaras](https://wordpress.org/support/users/gnotaras/)
 * (@gnotaras)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/migrating-to-same-domain/#post-7121862)
 * Hello,
 * >  George, I’ve got a bit confused with the localhost stuff here. So to clarify
   > the current situation.I have copied all my public_html files to my new host,
   > and restored the database, apparently successfully.
 * Then the job is almost done. The only thing left to do is change the relevant
   records in the DNS zone so as to point to the new IP.
 * In order to test without changing the DNS zone, you could trick the browser by
   adding the relevant entries in your desktop’s `hosts` file as described above,
   but from what I read you have also done that.
 * >  I have disabled .htaccess and at the newly copied database has the same name
   > and user as the old one.
 * htaccess is necessary. The only thing needed is to make sure that any security
   plugins do not interfere with you local test installation. Otherwise, please 
   leave the htaccess file in tact.
 * >  I am trying to test my new hosting prior to changing my dns. I have changed
   > my Hosts entry and now when I ping … it returns NNN.NNNN.NNN.NNN which fwiw
   > is the IP address of my new host’s server.
 * This means that you have set up the local hosts file correctly for the test.
 * All that is left is test the web site with your browser from the box on which
   you have modified the hosts file.
 * >  The codex just says “to test before you switch, you must temporarily change“
   > siteurl” and “home” in the database table “wp_options”” but to what do I change
   > them? With no changes accessing my root domain and subdomain sites just goes
   > to my old host.
 * There is actually nothing that needs changing in the database since you are just
   switching hosting providers (just different IP). If your goal was to also change
   the domain name of your web site, then making the changes to the database would
   be necessary, but this is not the case.
 * I assume that the codex page refers to the case of changing the domain name of
   your web site. BTW, there are many ways to do things. The codex sometimes tries
   to cover all of them for the convenience of users, so I’d suggest posting the
   exact page you are referring to would be very useful in order to understand what
   it is about.
 * Apart from all the above, I outlined the required procedure above. If any other
   steps were required, I would have posted them.
 * For anything else about a localhost installation, please post a new question 
   in the ‘Localhost’ forum.
 * Hope these help.
 * Kind Regards,
    George
 *  [George Notaras](https://wordpress.org/support/users/gnotaras/)
 * (@gnotaras)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/migrating-to-same-domain/#post-7121863)
 * Also, I should note that I’ve done all these tests with Mozilla Firefox on Windows.
 * Any changes made to the operating system’s `hosts` file took effect immediately
   without even having to clear history or flush the DNS cache.
 * This is just a note just in case any other browser performs DNS resolution in
   a way that bypasses the operating system. However, I’m not aware of any such 
   thing, but then again I haven’t done any research about it.

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/migrating-to-same-domain/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/migrating-to-same-domain/page/2/?output_format=md)

The topic ‘Migrating to same domain’ is closed to new replies.

## Tags

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

 * In: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
 * 22 replies
 * 2 participants
 * Last reply from: [patbell101](https://wordpress.org/support/users/patbell101/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/migrating-to-same-domain/page/2/#post-7121921)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
