Hello Linode and New Subdomain

Published 2012-10-06 on Farid Zakaria's Blog

All Aboard Linode

I've just finished transferring my blog and files in general from my previous shared hosting solution at bluehost.com to linode.com. The amount of freedom and boostrapping needed to move my website from bluehost to linode has been amazing and annoying...

Linode offers amazing beginner guides which were invaluable to the migration however this blog post this blog post outlines a lot of information on moving a WordPress blog.

New subdomain!

You might also notice that my blog is now hosted on a new 'blog' subdomain. I hope I've fixed a lot of the links however if you notice some broken ones, please send me an e-mail!

Notes on Migrating Wordpress to Linode

Tips

  • Change group of wordpress files to www-data (the group apache2 runes under)
  • Change ownership of wp-content to be 755 so that you can upload photos and it can access them.
  • Update your .htacccess file (see below).
  • Update your database with records pointing to your new domain!

.htaccess file



order allow,deny
deny from all

# disable the server signature
ServerSignature Off


order allow,deny
deny from all

# who has access, who doesn't
order allow,deny
allow from all

# disable directory browsing
Options All -Indexes

# set the canonical url
RewriteEngine On
RewriteCond %{HTTP_HOST} ^ryourdomain.com$ [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]


RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Update database


UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');