About a week ago, I was alerted by a friend through twitter that my blog had been hacked, and all content was gone. Fortunately I had most stuff backed up, but my last complete backup was 2 months old. I was lucky enough that when I informed my hosting company, they had a backup only 2 days old, which they restored. I then changed all passwords relating to it and made further backups of the up to date blog, including the database.
To my surprise, less than 8 hours later when I woke up the next day, it had been hacked again, in exactly the same way. I reported it again to my host, who told me it was hacked through WordPress and to make sure I don’t have any unofficial plugins installed. They offered very little help, other than to once again offer to restore my site. This time, having made sure I had a complete up to date backup, I decided to move it to the host I use for my other site.
This sounded difficult at first, but is actually quite easy. Here’s a quick run through of what I did. This move was between hosts, the domain used was the same. I think the steps when changing the domain of a blog would be more difficult. Make sure you have everything backed up before you begin, including your database.
- Change your domain’s DNS records to point to the new host.
- Install WordPress on the new host, creating a new database for it to use.
- Give the new database the same name as your existing one.
- Upload the contents of your wp-content folder into the wp-content folder on the new server.
- Go to your blog in the browser. You will be able to complete the WordPress installation from here. (If you don’t see this page, allow more time for the DNS settings to update. This may take up to 48 hours.)
- When configuring WordPress, use the same username, password and email address as before.
- Now when you visit your blog, you should see a blank WordPress blog with example posts.
- Drop all the tables in the new database.
- Import your backup database into the (now blank) new database. It should now contain all your original tables.
- Find the wp-config.php file on your new server.
- Edit this file so the $table_prefix value matches your original database table names. (Your table names will be look like wp_posts, wp_comments etc. Here, the prefix is wp_ so make sure $table_prefix = ‘wp_’;)
You should now be able to visit your blog and find all of your posts, images, theme and plugins the same as before. You will be able to log in with the same username and password you were using before you moved your blog (as these are part of the database you have imported). You will be able to login using the same username and password for WordPress that you had before. If you did set a new password while installing WordPress, you will need to change it, as it will be the old one that is in the database.
Hopefully this guide will help a few of you, but it may not be perfect. I may end up revising it in the coming days if I find I’ve mixed things up or got something wrong. Make sure you have all content and databases backed up before you attempt any move. If possible, keep your blog on your existing host until you are sure it has been moved and works correctly on the new host. At least then you will have a fall-back option if the move fails. Hopefully you won’t be in my situation, having been hacked with nothing left on your original server!
Recently, I decided to delve in to the internet for the first time in almost 10 years, and registered my own domain. Choosing the domain name took a considerable amount of time, and in the end came about after someone online misread the nickname I was using. For some reason, it stuck in my head, and suddenly I had my domain name.
Next came the more difficult decision, choosing a web hosting provider, for the main reason that I did now know what features I would need, the amount of web space or bandwidth would be suitable, or even, as once asked, if I would need a Windows or Linux based package. While the difficulty in choosing a domain name was down to my own (lack of) creativity, this difficulty was down to my lack of technical knowledge about web hosting. Fortunately I had some help and was soon able to short-list some providers, all offering similar features, but at varying prices. I was even able to demonstrate cPanel in a couple of places which helped a lot, as I knew that this would be useful.
In the end, I found a company offering Linux based hosting with unlimited hosting space, unlimited bandwidth, unlimited sub domains, unlimited SQL databases, unlimited e-mail addresses and a long list of features, some of which I understand and some of which I don’t. The price was reasonable too, 2 years of hosting for under £48, which was the factor that pushed me towards them over some of the other companies I shortlisted. The company chosen, HostClear is part of a larger company, Just Develop It, with their data centre in America, but UK offices and support based in Hampshire. While this did originally put me off, it seems that most hosts, even offering pricing in GBP, are just UK offices of larger companies, with very few data centres actually in the UK, and with hosting on these costing considerably more.
So here I am, now with both a domain and a website, and very little idea of what to do with, but knowing that I want to try different things and learn all about web development, as it seems to be a useful skill to have these days. Although I have never blogged before, I thought it would be a good idea to start one, and give me somewhere to write about my experiences developing my website, and really, just messing about with the internet. Obviously that presented another difficult choice, which type of blog do I want to use? After asking a couple of people and receiving the same almost instant unwavering answer, I installed WordPress, a simple and painless process, far easier than I thought. I was even able to install a new theme from the WordPress site without any trouble, although I may change this a few times in the near future once I have explored a bit more, until I find one I am comfortable with. Who knows, it may be that I end up back with this theme, as I do quite like it already.
Now, I’m trying to work out what I want to do with my site, what I would like to put on it or use it for. I may create a personal page, with some information about myself, the work I am doing, things of that nature, or I may not, at this stage I don’t have that many ideas. But whatever I want to do with, the point is for me to learn about web development, how things work and what different things mean or do.
Check back over the coming weeks/months to see what I get up to, if there are any developments on the site, or just new blog entries, as I have fun trying to figure it all out