Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've been developing a WordPress site for a client on my own hosting and domain and within the next week I'll be moving it to theirs. I have a number of questions regarding this as this is my first time doing something like this.

  1. Once i've moved all the files and uploaded the database I plan to use the Search & Replace plugin. So say currently the site is at mywpsite.com and i'm moving it to newsite.com. Will simply Search & Replacing mywpsite.com with newsite.com change all links in the database as well as links to posts, pages, images etc. and have the site functioning correctly?
  2. I've heard about deleting a licence file to make it harder to compromise the site security. Where exactly is this file and will the file be recreated every time WordPress is updated?
  3. While i'm uploading and fixing the new site I would like to take their current site - newsite.com and move it to subdomain.newsite.com and redirect to there. How would i go about doing this?

I'm sure these questions are simple enough but, as I said, this is my first time doing something like this and I'd appreciate any help with it. Thanks.

share|improve this question
    
    
    
    
There are plenty more available in WPSE search results. :) –  Brian Fegter Oct 11 '12 at 12:58

2 Answers 2

up vote 3 down vote accepted

Sounds like you know what you are doing that's a good start at a migration checklist :)

FWIT ...

  1. Search and Replace is a very good plugin

    • make sure you have a backup (my plugin DBC Backup 2 can help there) of your SQL database before you run it (just in case)
    • Try to always set you're image and other URLs as relative (then you won't have to change or fix them when the domain name changes)
    • use a tool like Xenu's Link Sleuth or Scrutiny for Mac to check all your links (or the broken link checker plugin)
    • When you do the move have -- SequelPro, PHPMyAdmin or SQLYog handy. Because ...
      warning you'll have to edit the SQL table for WP_Options and change site_url and home_url you can edit WP-Config as a temporary fix
  2. I think you mean the readme.html file in the 'wordpress' root folder and yes it does get added again next time WordPress is updated

  3. This is best done in an .htaccess file and a simple redirect rule like this will do the trick. Have a look at perishablepress.com
    'Redirect 302 http://newsite.com http://subdomain.newsite.com'

share|improve this answer
    
Thanks. Regarding Point 1 - try to always set your images as relative. What I have been doing is uploading images to the WordPress site from the Admin menu where it then gives me an absolute link to the image. I thought this was the way to go about it - is there a more appropriate way? –  garethdn Oct 11 '12 at 18:01
    
Yes that is one annoying factor of the media uploader is that it likes absolute URL's ... personally I just edit them to make them relative. Before you migration ... using Search & Replace plugin you could search from 'src="oldsite.com'; and change it to make it relative. –  Damien Oct 11 '12 at 18:35
    
I have a couple more questions if you don't mind. The way I usually perform backups is to download the entire site folder via ftp and make a backup of the database. I assume this is fine rather than using a plugin? Regarding Point 1.4, are you saying I should navigate to the WP_Options table in MySQL, find the site_url and home_url entries and change them both to newsite.com? Lastly, would you agree with brasofilo below about Frank Buelgte's plugin not being appropriate? Thanks again. –  garethdn Oct 12 '12 at 10:53
    
copying everything under wp-content via FTP is all you should need to copy. And you must use a SQL utility like PHPMyAdmin or my backup plugin to copy the database (as it is not part of the wordpress folder) ... If you don't amend the wp_options table, when you move the site, you won't be able to access it. See also codex.wordpress.org/Moving_WordPress Re Search & Replace plugin, this will work for image urls, post GUID and should be fine for most people. @brasofilo is right, so always backup SQL first and try search & replace on a test site. –  Damien Oct 12 '12 at 15:25

If you are going to do this kind of migration frequently, BackupBuddy would be a good acquisition as it is able to this in a matter of minutes.

Anyway, it's important to learn how to move WordPress manually so you can solve any problems that may appear along the way.
And for that, this Codex entry is a must read: http://codex.wordpress.org/Moving_WordPress

  1. If you are talking about Frank Bueltge's plugin, Search and Replace, it won't help you to start a WP migration. You'll need a tool like this: http://interconnectit.com/124/search-and-replace-for-wordpress-databases/, that's able to do serialized data replacements.
  2. It is not the license file that contains sensitive information, is the readme.html that displays the current WordPress version. As this file is put back at every update, I prefer to block its access through .htaccess, using the following rules:
    (liesmich.html is here to exemplify a german WP installation)
# PREVENT Access to Documentation Files
<files license.txt>
    order allow,deny
    deny from all
</files>

<files liesmich.html>
    order allow,deny
    deny from all
</files>

<files readme.html>
    order allow,deny
    deny from all
</files>
# END PREVENT

3. I'm really not sure about this scenario... What I'd do is to move WordPress into a folder (http://example.com/newsite/). Have it working there, move the old site to the subdomain and then move WP to the root (as described in the linked Codex article).

As a final note, I'd also suggest you to install MAMP or XAMP (or similar) in your computer, so you can poke around with WordPress and its database with ease.

share|improve this answer
    
Ups... I had this answer opened for a while, and didn't saw @Damien's... Well, now you have plenty of info :) –  brasofilo Oct 11 '12 at 12:05
    
that's ok ... i couldn't find the post which referenced the '# PREVENT Access to Documentation Files' –  Damien Oct 11 '12 at 12:40
    
@Damien - that line is mine :) - wordpress.stackexchange.com/q/5400/12615 (referenced here) –  brasofilo Oct 11 '12 at 12:53
    
oh thats ok .. so long as you reference DBC Backup 2 for me :) –  Damien Oct 11 '12 at 13:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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