WordPress migration to a new host – Part 2

Preparing the new platform

  1. Create a new directory
  2. Create a new SFTP account
  3. Create a new mySQL DB and user
  4. Update wp-config.php
  5. Update DNS to point to the new folder

Create a new directory

Just one minor rant before I get started – 1&1 your cPanel replacement is rubbish!!!

Anyway job number 1 is creating a folder on the server for everything to be dumped into.

  • Log into 1&1 admin page > left-hand menu ‘Web Hosting Overview’ > WebspaceExplorer

This brings up a new page with an embedded folder view.

  • ‘New folder’ icon or select ‘file’ > ‘New folder’
  • type the folder name > ok

Create a new SFTP account

  • Left-hand panel ‘Secure FTP account’
  • Select ‘New user’ button
  • Complete desired:-
    • User name – or more precisiely the second half of the desired username as it uses the main account name as the first half.
    • Password, also with a ‘Repeat password’
    • Description – one habbit I’ve made myself get into is always writing meaningful descriptions to my future self
    • Directory – point this at the newly created directory above
  • click the ‘save’ button

Rather than creating a global account and using this for all sites I’m compartmentalising everything – to keep it all segregated and in order.

Create a new mySQL DB and user

  • Left-hand panel ‘MySQL Database’
  • Select ‘New database’ button
  • Complete the desired info:-
    • Description of the new database
    • Version of the new database : MySQL 5.5
    • Password & Repeat password
  • Click ‘set up’
  • Note down the details of the database
  • Click ‘Go To Overview’

Update wp-config.php

Next the new database settings need to be added tot he wp-config file.

  • In the root directory of the downloaded site open wp-config.php with a text editor – Notepad++ for me.
  • Change the following, to the values from above:-
    • define(‘DB_NAME’, 1&1databasename’);
    • define(‘DB_USER’, 1&1username’);
    • define(‘DB_PASSWORD’, 1&1password);
    • define(‘DB_HOST’, 1&1hostname’);
  • Save this

Update DNS to point to the new folder

  • Left-hand panel > Domains
  • Click ‘Transfer domain from another provider’
  • ‘Domain check’ > type in the domain > select the right top level endind > click ‘check’
  • select/check ‘Point DNS to 1&1 name servers and keep your current registrar.’ > ‘next’
  • select ‘Use the 1&1 mail servers.’ > next
  • Note down the details > click ‘order’

Next the new domian needs to be pointed at the right folder

  • Left-hand panel > Domains > ‘Manage domains’
  • Select the relevant domain > ‘Edit Destination’
  • In the Webspace section select the desired folder > ‘save’

 

WordPress migration to a new host – Part 1

I intend to do the move in three stages:-

  1. Export and download the current site – files and DB
  2. Prepare the new platform
  3. Upload and Import the content and DB
  4. Alter domain details to point to the correct nameservers

Simple…I hope

First up Satiricalblog.com – which on first look at the admin section reminds me how infrequently I use this blog, kill the spam from the comments section (243 waiting approval) or update things (20 updates pending).

So pre-step 1  is getting it all updated so everything it going across clean.

Export and download the current site

  1. Grab a WordPress export of the site
  2. Export the MySQL Database
  3. Download all WordPress files via SFTP

Grab a WordPress export of the site

Time to grab an export of the site which will contain the posts, pages, comments, custom fields, categories, and tags

  • Log into the admin section -> Tools -> Export
  • Select ‘All content’
  • Click ‘Download Export File

Doing this just highlights my frustration with my current hosting package as several times I ran into ‘502 bad gateway’ error messages. However I still ended up with a fairly hefty xml file.

The above phase isn’t 100% necessary as I’m going to take an extract of the database but I like the ‘belt and braces’ approach.

Export the MySQL Database

So onto the database extract and for this I need to log into cPanel.

  • From the home screen > Database section > phpMyAdmin

This step again highlighted an important lesson I need to bear in mind on the new platform – keeping database naming conventions in mind and relevant to the site/project. Fortunately I had named this sites DB something relevant – more by luck than judgement.

  • In phpMyAdmin select the database from the left-hand panel
  • Then in the right-hand panel click ‘export’
  • Select the option ‘Quick – display only the minimal options’
  • Select the ‘SQL format’
  • Click ‘OK’

This downloads an sql file with all the DB content.

Download all WordPress files via SFTP

Now it’s time to grab the files from my current host via good old ftp.

For this I chose to use WinSCP, having not used ftp clients in many years it seemed to have the best reviews and least malware.

One thing to note here, I grabbed everything rather than getting picky over which files I might need.

So while that transfers I’m going to get some sleep.

Peace

G