pictures

Quick Site Backup (files and database) Via the Command Line

hr
hr Heading 2 Icon Quick Site Backup (files and database) Via the Command Line

If you do any sort of web development, it is more than likely that CPANEL and phpMyAdmin are good friends of yours...and you depend on them. Even though those are extremely handy to create/modify databases and create backups, it is extremely helpful to know how to do the same thing by using only SSH and command line utilities.

To backup (export) a database using the command line interface (CLI):

CODE:
mysqldump -p --user=username --add-drop-table database> backup.sql

You will then need to provide your database password and the exported data will go into a file called "backup.sql" which is located in the directory that you are currently in. (more mysqldump documentation

To backup your files:

CODE:
tar -cvzf backup.tgz directoryname

The command will create an archive of all your files so you can easily move or store one file (the archive). More tar documentation.

repairing a mysql table

hr
hr Heading 2 Icon repairing a mysql table

I have run into some database problems over the years, but had to do something different today when I saw that this site had a problematic table (wp_posts). When I looked at the issue first, I got the message "MySQL error code 145 = Table was marked as crashed and should be repaired".

To repair a table, I have run (at a mysql prompt in the command line): REPAIR TABLE wp_posts; but today that did not work. After doing some research, I finally was able to fix the table by using: myisamchk -r wp_posts (see documentation. This was a lifesaver!

apache, mysql, php update.

hr
hr Heading 2 Icon apache, mysql, php update.

Finally after two years of contemplating the updates to Apache 2.x, MySQL 5.x, and PHP 5.x, I finally updated my server to the latest version os Apache, MySQL, and PHP. I was not too concerned about custom work or any of my WordPress sites, but I was concerned XOOPS and/or XOOPS modules would have some problems, but it is now a week later and everything is running smoothly. Why finally? Well, as of the end of this month, support for PHP 4 will be discontinued. Better late than never. Time to update your servers too?

out of disk space.

hr
hr Heading 2 Icon out of disk space.

If you all the sudden get database errors (select, cannot login, cannot write, etc) - and everything looks ok (from the database end of things) check to make sure you have not run out of disk space. How do I know? Well - let's say last night I had to do a major fall clean-up. If you know me and my monitoring habits, this will sound a bit confusing because one of the many things I monitor is disk space, but when your hosting company accidentally halves your disk space - trouble can occur, and quickly. I have not had many issues at all with Liquid Web - but this was major...and handled a little slower than I would have liked.

mysql tips.

hr
hr Heading 2 Icon mysql tips.

After several days of researching and reading about how to solve a MySQL replication problem, I found a great resource on MySQL I thought I would share: MySQL Tips.

so long, farewell ben!

hr
hr Heading 2 Icon so long, farewell ben!

After working with Ben for almost eight years he had decided to move on. I wanted to wish Ben all the luck in the world. We had a great time working together for many years...as he put up with my on again off again relationship with Mac OS X Server and I put up with his "not as funny as he thought" videos and comics ;) We also had a good time playing Carmageddon 2, Diablo, Diablo II and Quake 3 Arena. We did do some great work in between all the games and great music (I got him out of the "ambient" music mode and opened the door to electronica, DJs, etc). We did do a kick ass job of putting together a really sweet Mac OS X/Mac OS X Server server set up using Apache, MySQL, PHP, WebObjects complete with failover. Best of luck and thanks for the good times.

my first wordpress plugin: WP-rssStats.

hr
hr Heading 2 Icon my first wordpress plugin: WP-rssStats.

After talking to Scott I finally have a plugin which I am excited to develop and excited to share with the WordPress community...a plugin that will allow WordPress admins to see exactly how many people are subscribing to your WordPress RSS feed and who these people are. Why would I do this when Feedburner is out there (and I used it currently)? I like Feedburner but I do not like redirecting my RSS feed to a non jappler.com URL because I want to be in control of my own stats.

Why start with this? Scott had mentioned this to me and it sounded very interesting. With this project, I will be able to learn quite a bit about PHP, the WordPress API, MySQL, as well as RSS. This past weekend, between meetings, I read the documentation I blogged about yesterday and I started reading PHP and MySQL Web Development, which Scott recommended. I hope others will find this useful! I plan to really dig into this in the next few days. I am going to set up my test WordPress setup tomorrow so I can begin messing ... [more]


search

subscription information

Blog RSS

Comments RSS



Powered by FeedBlitz

blog categories

blog tags

most popular posts


blog archive

standards

Get Firefox!
XHTML
CSS