How do I backup my database?

Question:

How do I download a backup copy of my database.

Answer:

The best method is to login to ssh and type:

mysqldump name_of_your_database -u your_username -p > database_dump.sql

it will ask you for your password, enter it and then wait 🙂

When it completes you can also type:

gzip database_dump.sql

which will compress the file (usually by a lot since it is highly compressable data in most cases).

The new file will be :

database_dump.sql.gz

You can then ftp this to your local computer, etc.

If you ever need to open it, most windows and mac decompressors (winzip, etc.) can decompress the file. All unix/linux servers will be able to decompress it.

You can also use phpMyAdmin in the control panel. However we have found that for larger backups it sometimes does not work as smoothly.

I hope this helps!

Leave a Reply

Your email address will not be published. Required fields are marked *