-
Backing up a Wordpress Blog on GoDaddy
Posted on September 22nd, 2009 1 commentBlogging is a great way to prepare content for the Internet without spending a lot of time worrying about the details of website administration and content formatting. But it’s easier to put content in a blog than it is to get it out of the blog for backup purposes. Wordpress has a way to export the postings and comments into an XML file for local storage, but since you have to remember to do it periodically, you’re likely to lose a few postings if something goes awry on the server and you haven’t done a backup for a while. And the XML export doesn’t save the images you may have uploaded to your web host because those are not stored in the same database as the posts and comments.
I started looking around for a Wordpress backup solution and was unable to find anything that looked like a good fit. Wordpress posts and comments are not located on your GoDaddy web host. They are on a separate host/database that GoDaddy sets up when you install Wordpress as an application. I download my website’s changed files to my local PC using a scheduled WS-FTP session. I generally use FileZilla for FTP and would like to use it instead of WS-FTP, but it doesn’t have a way to automate periodic downloads so I’m forced to use WS-FTP for my backups. WS-FTP isn’t free, but until FileZilla supports recurring automated scheduling of uploads/downloads, it’s the only way I know to do this. The FTP backup takes care of downloading my blog images and other website files but not the actual blog postings or comments.
GoDaddy has a web interface to set up cron jobs and I was pretty sure I could back up my blog’s database to the same Wordpress directory that stores my blog’s theme and php files using a script to dump the database. A database dump could put a copy of the postings and comments in SQL format in a location where my WS-FTP job could find it and download it on a regular basis.
I figured others would like to know how to do this, so I’ve written up a short ‘how to’ here.
I will assume you have are using GoDaddy’s Linux hosting and have an SSH login and know your way around a Linux system. If not, you’ll need some help from a Linux expert who can understand the instructions below.
First of all, you can use a single command to perform the Wordpress database backup manually, to make sure it’s working. Here is an example of mine which I store in a file called “wpbackup” located in the wordpress directory (please note, this command should all be on a single line):
mysqldump --add-drop-table -h mysqlhostname -u mysqlusername -pmysqlpassword mysqldatabasename | gzip -c > $HOME/html/wordpress/yourblogbackup.sql.gzIf you can’t remember the mysql hostname, username, password, and databasename because GoDaddy generates them for you automatically when you install Wordpress as an application, you can find them all in the /wordpress/wp-config.php file. Please note that there is no space between the -p and the password. All other spaces are required. The mysqldump command takes all the data from your wordpress blog database and puts it in a SQL format that allows you to re-import it should the need arise. The “| gzip -c” compresses the database since SQL is made of plain text and it compresses pretty well, probably 4:1 or better. If you don’t want to use it, you can leave it out.
You will need to confirm that this is working properly. Just make sure it’s executable and type in “./wpbackup” to run it. Then you can do a “gzip -d” on the yourblogbackup.sql.gz file to turn it back into sql statements so you can browse the contents of the output file. Once you’re sure it’s working, then you are ready to set up the cron job. It is possible set up a cron job manually by editing the crontab file in your home directory, but GoDaddy has a web interface that allows you to set up and manage cron jobs without having to know how to edit the crontab file directly. You can see the result in the crontab file by looking at it in your home directory after you set it up if you’re curious.
Just go to the Hosting Control Center -> Content -> Cron Manager
Set up the job to make the wpbackup script execute on a regular basis. It should be done frequently enough to insure that your FTP download is getting a recent backup of the database.
With the cron job executing on a regular basis, and a scheduled FTP download of your website, the most recent content from your blog will get backed up so that should misfortune strike, you’ll be able to restore it to its original condition. The two commands to do that are:
gzip -d yourblogbackup.sql.gz
mysql -h mysqlhostserver -u mysqlusername -pmysqlpassword mysqldatabasename < yourblogbackup.sql(please note, the mysql command should be all on one line)
If you found a better or easier way to backup your Wordpress blog, please leave a comment with a link to your solution.
-
EAA Chapter 1117 Website
Posted on October 13th, 2001 No commentsFinally, the weekend has arrived. I managed to get the local chapter EAA newsletter out this week, but just barely made it. I try to get it out on time to notify the others in the group about the upcoming monthly meeting and thanks to the fact that most of them now have email, I can do it with less lead time than when I mailed each one out via postal mail. I feel like I’m writing it to myself sometimes since I’m not even sure it’s being read by others in our little EAA Chapter 1117 Website. I’ve thought of keeping some of the newsletters on-line, but can’t justify the space for old newsletters so I only keep the latest one. Writing a newsletter is a lonely business and judging by the number of folks who have abstained from volunteering to take over the job in the past 6 years I’ve had it, not a very sought-after role either.
I updated my guest book today so it’s not quite so generic, but am still waiting for my first entry.
-
My Attempt at Blogging
Posted on October 8th, 2001 No commentsWow, this blog method of capturing up-to-date musings is certainly more convenient than the old way of doing things. I don’t know if I’ll continue on faithfully, but it’s much easier than using FrontPage or editing raw html to keep the site fresh and updated. I actually don’t use FrontPage at home anymore, although I still do at work. I had a version that expired after 50 uses and by that time, I had most of the formatting done. So now I just have a local copy of all my html files in a directory and I edit it with Wordpad, save it, copy it, and then paste it to an open FTP window that links to the web server. In some ways it’s easier but there’s a lot of intermediate saving and looking at the result in a browser since html makes it easy to leave off important formatting characters which will screw up a whole page.
I changed the format of my index page today since I got tired of looking at it. It had a debris trail of the old look and feel that was hard to read. I took out nearly all the text and put it in a table that describes other parts of my web site. I am so embarrassed by my site when I look at what youngsters have been able to do with their web sites from an appearance standpoint. They may be short on content, but the sure do look nice. Many of them have their own domain names and big name web hosting companies handling them. No Geocities, AOL, or @home for them, nosiree. They’d outgrow them in no time at all. I’ve allowed my site to grow to the point where I’m on my second 10MB chunk of @home’s web space. Much of it is eaten up with the FT100 FAQ which is my most visited page.





Recent Comments