linux,ubuntu linux,ubuntu guide,linux technical documentation

Backup

Mysql DB Backup and Restore How to

by admin on May.31, 2010, under Backup, RHEL5, Ubuntu, Ubuntu 9.10, ubuntu 10.04, ubuntu 7.10, ubuntu 8.04, ubuntu 8.10, ubuntu 9.04

Database Backup

If you’re storing anything in MySQL databases that you do not want to lose, it is very important to make regular backups of your data to protect it from loss. It is also a good idea to create a backup before making any major changes, incase something goes wrong and you need to revert to the unmodified version. Database backups can also be used to transfer your database from one server to another if you change web hosts.
Command Line (using mysqldump)
# mysqldump -u user_name -p your_password database_name > File_name.sql

Eg:
Let’s assume that:
Username: ubuntu
Password: jaunty
Database Name: ubuntulinux

# mysqldump -u ubuntu -p jaunty ubuntulinx> ubuntulinux.sql

This will backup the database to a file called ubuntulinux.sql

Back up more than one database
In this case you can use the –database option followed by the list of databases you would like to backup. Each database name has to be separated by space.
#mysqldump -u root -p –databases ubuntu ubuntulinux > data_backup.sql
Backup all Database
Back up all the databases in the server at one time you should use the –all-databases option. It tells MySQL to dump all the databases it has in storage.
#mysqldump -u root -p –all-databases > all_backup.sql

Database Backup From the phpMyAdmin

1. Login to phpMyAdmin
2. Click on your database name
3. Click on the tab labeled EXPORT
4. Select all tables you want to backup (usually all)
5. Default settings usually work, just make sure SQL is checked
6. Check the SAVE FILE AS box
7. Hit GO

Database Restore

Restore Database From the Command Prompt

If you are moving your data to a new server, or you have removed the old database completely you can restore it using the code below. This will only work if the database does not already exist:

#mysql – u user_name -p your_password database_name < file_name.sql

Or using our previous example

#mysql – u ubuntu -p jaunty ubuntulinux < ubuntuBackup.sql

If your database already exists and you are just restoring it, try this line instead:

#mysqlimport -u user_name -p your_password database_name file_name.sql

Or using our example again:

#mysqlimport -u ubuntu -p jaunty ubuntulinux ubuntuBackup.sql


Restore Database From the phpMyAdmin
  1. Login to phpMyAdmin
  2. Click on the tab labeled SQL
  3. Unclick the ’show query here again’ box
  4. Choose your backup file
  5. Hit GO
Leave a Comment :, , , , , , more...

Thunderbird mail and profile backup on Ubuntu

by admin on May.28, 2010, under Backup, RHEL5, Ubuntu, Ubuntu 9.10, ubuntu 10.04

Thunderbird allows you to customize your email to suit your specific needs.

In Linux Mozilla thunderbird stores your email and profile setting in a special directory called ~/.thunderbird i.e. /home/you/.thunderbird/ or ~/.thunderbird directory. All you have to do is backup this directory.

Backup Thunderbird mail and profile

backup thunderbird mail and profile to a /backup directory
#sudo mkdir /backup
#tar zcvf /backup/email-ubuntu-181aug2009.tar.gz /home/ubuntu/.thunderbird/

Restore Thunderbird mail and profile

Make sure Thunderbird is not running. Simply copy backup files from USB pen or CD to your /home/you/.mozilla-thunderbird/ directory:

$ tar –zxvf /backup/email-ubuntu-181aug2009.tar.gz-C /home/ubuntu

Or just copy all files from USB pen/CD to ~/.thunderbird/ directory.

Leave a Comment :, , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...