I have some wordpress websites on one server that I want to download. The problem is I don't know what url or what server I am moving it to. The problem is I do want the original to work. Suggestions on what I should do?

This Wordpress Codex suggests I already know where I am moving the wordpress... Suggestions on what I should do?

3 Answers 3


I wouldn't worry too much about it - just download all databases and files.

And if you're uploading them to the new server, change the wp-config files and run the following queries on the databases:

UPDATE wp_options SET option_value = replace(option_value, 'http://www.example.com', 'http://www.newurl.com') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'http://www.example.com','http://www.newurl.com');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.example.com/', 'http://www.newurl.com');

If your permalinks are still not working, delete the .htaccess file, and go to Settings->Permalinks and click save to create the .htaccess file.

  • No entirely different server, entirely different domain. It might be local or through some provider I'm not sure yet.
    – Howdy_McGee
    Nov 29, 2011 at 17:47
  • OK Thanks, since I am not 100% if this will work I won't give it a "answer" mark yet. Enough upvotes i'll give it a check.
    – Howdy_McGee
    Nov 29, 2011 at 18:03
  • you're welcome. this is exactly what i always do if i move my wp sites from localhost to online server - and it always works like a charm. no prob for the 'answer' mark!
    – ptriek
    Nov 29, 2011 at 18:05
  • It took awhile but this was the easiest, safest bet. Worked like a charm thanks!
    – Howdy_McGee
    Apr 30, 2012 at 11:52
  • 1
    just for future reference: since a couple of months i'm using the wonderfull backupbuddy plugin for all wp migration - it's not free, but it saves me loads of time - and offers lots of other pretty interesting features (eg. automatic offsite backups)
    – ptriek
    Apr 30, 2012 at 16:21

You might want to read through this article before going ahead with any search and replace in the database:


Doing a basic SQL replace takes no account of serialised arrays and could mess up plugins and other settings. This might be overkill, but if you have a large site with several plugins this could come avoid problems later.

I personally always use this little tool. It's also handy because you can simply copy it to your wordpress folder and run the update from your browser.

  • Works like a charm, indeed!
    – ptriek
    Feb 23, 2013 at 7:03

The following links should guide you apart from what @ptriek has suggested. http://codex.wordpress.org/Changing_The_Site_URL#Relocate_method http://codex.wordpress.org/Changing_The_Site_URL#Changing_the_URL_directly_in_the_database

You can also try setting WP_SITEURL and WP_HOME in wp-config.php file. http://codex.wordpress.org/Editing_wp-config.php#WordPress_address_.28URL.29 http://codex.wordpress.org/Editing_wp-config.php#Blog_address_.28URL.29

define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] );
define('WP_HOME',    'http://' . $_SERVER['SERVER_NAME'] );
  • Right I thought about hardcoding it like that (with define I mean) but I didn't want the ugly long url that came with it :S
    – Howdy_McGee
    Nov 29, 2011 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.