Backups are one of those annoying little tasks nobody thinks about … until something goes wrong and you realize you don’t have one!
If all your web pages are static and you have the originals on your PC, use a backup program or just copy to other media (CD, DVD, removable drive …). Plan on keeping several “generations” of backups, in case data on one is unknowingly corrupted by a virus or hardware malfunction.
Most hosting programs (like Cpanel) have a simple backup tool you can use. On Cpanel it backs up your files and downloads the backup to your PC, where you can archive it as above. If you have shell access to your account you can use platform-dependent OS commands to make your own backup.
If you have databases (forums, blogs, directories, rss feeds archived to a database, some ratings/polls/image management scripts, etc.) you need to back up that data too. This is the part everybody forgets. Don’t! – It really hurts if you lose all your forum posts because you have no backup!
For most MySQL installations, you can use PHPmyadmin to do this:
- Start PHPMyadmin and open the database
- Click the Export tab
- Select all database tables (unless for some reason you only want to back up one or more particular tables)
- Generally, the checkbox default values will work. Make sure the output format is SQL (you’ll notice other useful things here, such as the ability to export your data to use in an Excel spreadsheet), export type is “Insert”, and that “Structure” and “data” are checked. You also probably want to check, “enclose table/field names in backquotes” and “add auto increment values“.
- Check “save as file” and click GO.
- Repeat for each database on your site(s).
If you don’t have PHPMYadmin, read up on the MySQLDump utility or other options in the MySQL documentation, or check out the appropriate documentation for any other database you may be using.
[tags]backups, web sites, web site management, mysql[/tags]