WordPress MySQL Find / Replace When Moving Domains

Great piece of code to use when moving a WordPress site from one domain to another; quick way to replace the old domain name in the DB with the new one.

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

UPDATE wp_posts SET guid = replace(guid, 'http://olddomain.com','http://newdomain.com');

UPDATE wp_posts SET post_content = replace(post_content, 'http://olddomain.com', 'http://newdomain.com');

UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com');

Syncing Filezilla Sites across multiple computers with Google Drive or Dropbox

1. Find your site manager file
Filezilla keeps all of your sites and access credentials in an XML file called “sitemanager.xml” Here are the most likely locations:

Windows 7 & Vista :

Mac OS X:


2. Back it up
Just in case something goes wrong in the next few steps. Copy the file and name it something else, perhaps “sitemanager.xml.backup”

3. Move sitemanager.xml to Google Drive
I keep a folder in google drive called “Settings” which I use for program files that I sync. Place it where it makes sense to you, just remember that location for the next step. Note, you want to move the file, not copy it. It cannot still exist in the filezilla folder, or the next step may not work.

4. Make a soft link from Google Drive back to your Filezilla folder
Filezilla will still look in it’s default place for the sitemanger file. You’re going to trick it and point it to the file you have snyc’d on Google Drive. You’ll need to open up a Command Prompt (Windows) or a terminal (OS X/Linux) for this step. This is what the commands looked like for me, you’ll need to adjust the file paths as necessary. Note, on Windows, you enter the new link first, then the existing target, and on OS X & Linux, it is the opposite order.

mklink “C:\Users\pc\AppData\Roaming\FileZilla\sitemanager.xml” “C:\Users\pc\Google Drive\Settings\sitemanager.xml”

ln -s /users/pc/Google Drive/Settings/sitemanager.xml /users/pc/.filezilla/sitemanager.xml

ln -s /home/pc/Google Drive/Settings/sitemanager.xml /home/pc/.filezilla/sitemanager.xml

That’s it! Fire up Filezilla, and you should see the same site settings now on all of your computers. Note, if you use “Synchronized Browsing”, you’ll need to create separate bookmarks under each site for each computer, as the local path to your files will be different depending on your computer.