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

fixing the WordPress white screen of death

One of my biggest frustrations with WordPress has been the amount of times that, at seemingly random times, I would get a completely blank screen.
Now a little research, and enabling debug messages, turned up that this was typically due to various plugins overloading the php memory limit.

The mighty google thre up a few solutions, none of which seemed to work:-

  • increase the limit in php.ini – as I’m on a shared hosting platform this wasn’t editable (is that even a word?)
  • override the limit per directory via .htaccess – which just resulted in the whole site throwing an internal server error (500)
  • override the limit at run time via by adding [define(‘WP_MEMORY_LIMIT’, ‘128M’);] to wp-config.php – which seemed to make no difference
  • override the limit per script by adding [ini_set(‘memory_limit’, ‘128M’);] to the relavent functions that are causing issues – again no dice

So I was almost at the point of raising a ticket with my hosting provider in the depressing anticipation of being told that increasing memory limits wasn’t an option on my bargin basement proce plan.

Then I had a though

Then I checked my research and spotted a tiny flaw….

All the articles I’d read were between 3 and 5 years – PHP had moved on quite a bit.

More research – some sleep – planting some sunflowers – and I found the answer

Since PHP 5.3 “.user.ini” can be used to override php.ini on a per directory basis – so in effect is the new .htaccess

Very simple – very straightforward and very workable….

http://kb.site5.com/php/how-to-make-custom-php-changes-using-a-user-ini-file/

 

Happy happy – now I can turn on all those lovely plugins that I had been skimping on

 

WordPress Theme creation

So part of rekindling of my blogging love is the firm commitment to learn how to create my own themes.
Partly this is due to the frustration at the current crop of themes not quite nailing it, and seemingly growing number that seem to charge for anything above the basics. This of course is a sweeping generalisation that has little basis in any fact other than my irritation that I can’t do out of the box the cool things I want. Also wedded to this frustration is a deep down belief that I probably could do better – the hubris flight leaves soon.

Where to start…

Well a quick tour around google turned up a number of starter themes each based on a variety of different frameworks and approaches. The flexibility of WP as a platform leads to a bewildering number of options to achieve the desired end result. So based on three main factors I picked Underscores (_S), the three factors being:-

  • It came recommended from a number of the top hits in google
  • It was the basis of the WordPress 2015 theme – if they like it it must be good
  • Its designed to just be hacked and pulled around – as opposed to being the parent of a child theme
  • It comes with it’s own config utility on hhtp://underscores.me that allows it to be branded appropriately before download
  • Ok this is factor number 5 – It has one or two great tutorials to follow
    (just to note – I’m anything except a reliable narrator of my own blog)

Having picked a suitably unoriginal theme name I filled out the details on Underscores.me and downloaded my nice new theme.

Installing it was simple and straightforward (as you would expect from WP) and similarly enabling it was straight forward…
Then came the shock of realising just how bare a starter theme can be…
galiquis_naked

Yep it looked like it was designed in the 80’s – which if I had engaged my brain wouldn’t of been such a shock.

But this led to a little complication. Although I wanted to learn the zen of theme building I didn’t want my site to look like amateur hour while I crafted my skills.

Luckily there were, again, lots of options on the font of all modern wisdom (google)… the one I picked was  installing a nifty little plugin called ‘Theme Test Drive‘.
This enables you to run a separate theme as administrator while the general public see a different one. This gave me the flexibility to craft out a new them behind the scenes – learning my craft as I go, while keeping the external view of the site untouched. Also it had a very cool option of allowing a url option to point to the admin theme – allowing a sneak peak.

http://galiquis.com/?theme=galiquis

Anyway its a start and as develop the new theme I’ll be posting here to track what I’ve done, and how it’s worked out.

Peace

G

Contact forms… which is best

What I’ve learnt from getting back into blogging has been how very different Word Press and Blogger are as platforms. Probably for all the right reasons – it just feels a lot more grown-up and serious.

Anyway I digress (marginally) from the point of this post – which is there are so so many options around design/widgets/forms/formats/categories/tags…almost too much!
It’s similar to the reason I sometimes avoid Subway – a bewildering range of choice.

‘You can have everything!’

…yeah but what if I don’t know what I want?

So I got to reading Jeff Bullas’ blog and a post about the 15 most common mistakes…and the section on contact forms caught my attention. This site is very much a work in progress but I hadn’t thought of really using a contact form – but actually after reading Jeff’s take on it I thought I’d look at putting a simple form together.

Which brings me to choice – there are hundreds of options for plugins that handle forms from a simple html form to cloud based filtered services that will integrate with your CRM. Where’s good old safe and easy blogger when you need it.

This led me into the ‘review minefield’ – multiply the number of plugin options by the number of reviews and suddenly a simple choice is somewhere in the middle of an ocean of information. Which at the speed I read devoured a good few hours.

After looking at all those reviews and ratings what did I decide to do?

Well I listened to Jeff’s advice and installed one of his recommendations.

Moral of the story?
Sometimes choice is good, flexibility and scale-ability is always nice – but sometimes a good recommendation is far better than hours lost in research on a new subject.

G