Domain Change WordPress (non-trivial)

i want to change my wordpress domain, from http://IP/folder1/folder2 to http://mydomain.de

I did google, i did follow the wordpress codex, i did download the whole database, did a search and replace on everything, i even modified my theme’s function.php

Read More

and still, when i go to mydomain.de, it shows mydomain.de, then i click any link and boom, it’s back to from http://IP/folder1/folder2.
The database remains unchanged by this, i still find mydomain.de everywhere.

i do not have a clue what is going on here. i am obviously missing something, but what??

thanks!

Related posts

Leave a Reply

3 comments

  1. I have done it similar to the way you describe, and it is possible but I don’t remember the steps, and it is easy to mess things up. I develop websites professionally, and always do it on a local server and then move them online.

    I have had great success with the plugin WP Clone. I would suggest you just install it, create the clone, install WordPress on your other site, install the plugin, and use it install the clone. It is so much easier, and you should be done in a few minutes. Of course you learn more the other way, and have higher blood pressure.

    https://wordpress.org/plugins/wp-clone-by-wp-academy/

  2. You can update your database to point to the new domain. And make the following changes in your wp-config.php

    define('WP_HOME', 'www.newdomain.com');
    define('WP_SITEURL', '/');
    

    In MySQL

    update wp_options set option_value = "http://www.newdomain.com/"  where option_id = 1;
    
    update wp_options set option_value = "http://www.newdomain.com/"  where option_id = 2;
    
    update wp_blogs set domain = "www.newdomain.com" where site_id = 1;
    
    update wp_sitemeta set meta_value = "http://www.newdomain.com/" where meta_id = 14;
    

    Note: These settings in MySQL might change a little bit, so just confirm by doing a select on the table you’re updating once. Mostly the structure should remain the same.

    Some of these tables might not be in a non-multisite version, so it is safe to ignore those update queries.

  3. Well the steps are pretty easy, i do it on a daily basis.

    1. Create a new folder on your desktop and Copy all the files of the
      website and place them in this directory. Also add your sql dump
      file to this folder.
    2. Now using notepad++ “CTRL+SHFT+F” or “Find in files”, replace
      ‘localhost/yoursite’ by ‘yoursite.com’ (donot use any protocols
      i.e http). This will also replace all the stuff in your sql dump.
    3. Now upload all the files to server + import the database.
    4. in your wp-config.php add these line on the top.

      define('WP_HOME','http://example.com');
      define('WP_SITEURL','http://example.com');

    5. You should be able to see the website now, all inner pages should also work. If some links dont work, then login to the admin panel goto settings>permalink and just hit the save button. It will update the .htaccess file and would remove most of the errors.

    You can also use duplicator plugin which will automate this whole process.