• Hi,
    I would like to move my WP installation to another domain, but the hoster and the folder on the server will be the same.

    Does it work if I connect the new domain with the the old folder on my server and change the settings in the wp-config.php?
    define(‘WP_SITEURL’, ‘http://www.mynewdomain.de’);
    define(‘WP_HOME’, ‘http://www.mynewdomain.de’);

    Could I use the old database?
    Do you have a good plugin for correcting the absolut URLs in the database?

    Thx for your help
    graphys

Viewing 7 replies - 1 through 7 (of 7 total)
  • You will need to configure the new domain, but you can leave the files as they are where they are.

    However, you will need to export the database to an sql file (via PHPmyadmin for example). Copy this file to a new one, in order to keep a backup of the original file.
    Open the copied file with a text editor and search-and-replace the old URL by the new URL. Save.
    Drop all tables from your database, then reimport the new sql file.
    This should be it.

    Thread Starter graphyss

    (@graphyss)

    Thx for your help…
    Maybe the Plugin “Search & replace” could do the manual work in the databases?

    You can use this plugin Velvet Blues Update URLs for “Search & replace”

    @graphyss what’s wrong with a text editor? 😉 Is that too 1990ies for you?

    @curlybracket: wrong; using a text editor in a DB dump to change URLs will break serialized data. Use Velvet Blues or run queries with phpmyadmin:

    UPDATE wp_options SET option_value = replace(option_value, 'http://www.olddomain.com/', 'http://www.newdomain.com/') WHERE option_name = 'home' OR option_name = 'siteurl';
    
    UPDATE wp_posts SET guid = replace(guid, 'http://www.olddomain.com/','http://www.newdomain.com/');
    
    UPDATE wp_posts SET post_content = replace(post_content, 'http://www.olddomain.com/', 'http://www.newdomain.com/');
    
    UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.olddomain.com/', 'http://www.newdomain.com/');
    Thread Starter graphyss

    (@graphyss)

    Thx all for your help!

    Interesting. However, simple text replacement has always worked correctly for me.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Moving WordPress to new domain on same hoster’ is closed to new replies.