Finding Great Web Hosting

Thoughts On The Best Web Hosting I Have Found...

Moving Your WordPress Blog to HostGator

My first experience with HostGator was moving a WordPress blog to HostGator. I had maintained this site at another hosting company for several years but after some slow performance and a few technical issues I decided to give HostGator a try. In retrospect, this was a great decision as everything with HostGator has worked out great.

Getting Your HostGator Account

The process of purchasing your HostGator account is straight-forward. I do want to cover a few points about this process though:

  • If you are looking for improved database performance over a standard shared hosting option, I recommended the Reseller Account. Even though I am not a hosting reseller, I purchased this plan simply for the improved database performance. It does cost $25, which is outside of the price range for many of us. However, if you’re looking for a step up from shared hosting but aren’t ready for the more dedicated server options I think the Reseller Accounts make a perfect stepping-stone.

  • After purchasing your hosting you will receive an email on how to change your domain name servers to point to your new HostGator hosting account. You won’t want to do this just yet though, that will come later.

Transferring All Files To Your HostGator Server

The process here is fairly simple: you will want to download all of your files from your current host to your computer. You will then upload all of these files to the public_html directory in your HostGator account. Keep in mind: at this point you will need to use the IP address of your HostGator account to connect to FTP. On a side note, this stage was where I saw my first real difference with HostGator compared to my previous hosting provider: even FTP activity was so much faster with HostGator.

Note: You can have the files transferred for free for you by filling out this form (within the first 30 days of your new account). This is a great option if you are not comfortable moving your files however I prefer to have control and moving the files yourself means you will not have to wait.

Setting Up Your WordPress Database

The first thing required in the database setup process will be a backup of your current database. Generally speaking, backups are the sort of thing you should be doing on a regular basis. If you are not familiar with creating backups, I recommend the following process:

  1. Log into your WordPress admin area and click on Plugins.

  2. Next click on Add New.
  3. Search for “WP-DB-Backup”. This is my preferred backup plugin. If you see multiple results or are confused by which plugin to install, look for the one created by Austin Matzko.
    install backup plugin

  4. Install and Activate the plugin.
  5. Click Tools and then Backup.
  6. In the top box, you will see the default options for which tables will be backed up. There is also the option to backup other tables, normally those created by plugins. I have never had to backup any of these tables but if you are unsure you should select to back them up.
  7. In the next box down select email and then enter your email and click Backup Now! The backup will be emailed to you. I normally do the email option so I have the backup available in my email later if I need it but obviously if you prefer you can also download the backup directly to your PC.
    backup now!

Creating Your Database at HostGator
Next, you need to create your database on HostGator.

  1. In your hosting cPanel, find the Databases section and click on MySql Database Wizard.
    mysql database setup at HostGator

  2. Enter your database name and click Next.
  3. Next enter you User Name and Password – I would recommend using the password generator as this will ensure the password is very strong. Then click “Create User”.
  4. On the last screen you will grant all the rights this user and click Next. You now have your database and database user created.
    Setting HostGator WordPress Privs

Restoring Your WordPress Database
Next, you need to restore the backup of your original database made earlier in these steps:

  1. Again in your control panel browse to the database section and then select phpMyAdmin.

  2. Click on your newly created database (which should appear in the left)
  3. Click on Import
  4. Click Browse and select the file that you either emailed to yourself of downloaded to your PC
  5. Click Go and your database should be restored.

Your WordPress database should now be restored to your HostGator account.

Reconfiguring Your WordPress to Use Your New Database
You will now want to browse to your WordPress installation and edit the file wp-config.php. You’ll need to change your Database Name, User Name, and Password to the newly created database and account. Also, your DB_HOST should be set to “localhost”. Some hosts require you enter a specific database name but at HostGator you will use localhost. Your config file will look something like this:

/** MySQL database name */
define('DB_NAME', 'hostingusername_databasename');

/** MySQL database username */
define('DB_USER', 'hostingusername_databaseuser');

/** MySQL database password */
define('DB_PASSWORD', 'SuperStrongPasswordHere');

/** MySQL hostname */
define('DB_HOST', 'localhost');

Remember that HostGator precedes your database name and user with your hosting account user name. So if my hosting account name is gatorfan and my database name is database1 then the DB_NAME would be set to gatorfan_database1.

Testing Your WordPress Blog (optional)

Testing is a little trickier than just loading the web page. These steps are for those who want to be absolutely sure that your WordPress blog is working and these steps are optional.

First, before you have updated your domain, you will need to access your site through the following address: http://ipaddress/~username/. So if your web server IP address were 127.0.0.1 and your username were gatorfan you would access your site with the following address:
http://127.0.0.1/~gatorfan/

Keep in mind that if you have your WordPress installation somewhere other than the root, you will need to include that in the address. For example, if you place WordPress in the “blog” directory you will use: http://127.0.0.1/~gatorfan/

At this point you will probably see your site but ever page will show as 404 (not found). This is because WordPress will need temporarily updated to fully test:

  1. Open your phpMyAdmin again

  2. Click on your database
  3. On the left, click on the table wp_options
  4. On the browse screen you need to find two options. The first is siteurl and the second is home. Both of these should currently have your site url which will looks something like this:

    http://yoursitename.com

  5. On each of these options click the pencil icon to edit the entry and in both cases change the value to http://127.0.0.1/~gatorfan/ (obviously you will want to enter your IP address and user name). The point is to change the address to the address you are currently using to preview the site.
  6. Now you can verify the site, test your plugins and so on.

WHEN YOU ARE DONE TESTING BE SURE TO CHANGE THESE SETTINGS BACK!

Updating Your Domain Nameserver

Now that everything is updated and tested, it’s time to update your domain to point to your HostGator account. HostGator has some great guides on doing this for some of the most popular domain companies (including videos which are very helpful).

After this point, you just wait. One “trick” I do at this point is I edit my WordPress footer and add a period or some other symbol to the bottom of my web page. I then check my website over the next few days and when I see the period or other symbol appear at the bottom of my site I know I’m now seeing my site on the new host.

Now just because you’re seeing your site on the new host doesn’t mean you should immediately cancel your old host. I would wait another day or two to ensure everyone is seeing your site on HostGator.

Congratulations! You now have your blog running up on HostGator!