How do I export or backup a database?

Before you use either of the following methods:

  1. Log in to the Brownrice Dashboard
  2. Find your database credentials
    • DB username
    • DB password
    • database name

To Backup/Export via phpMyAdmin

  1. From the Databases page, click the phpMyAdmin link and log in with your credentials.
  2. In the left sidebar select the databse to be exported.
  3. In the top menu-bar click 'Export'.
  4. Under 'Format', select the format you would like to export as.
    • Choose 'SQL' for a databse backup that can be used to restore.
    • Choose 'CVS' or 'CVS for MS Excel' for a spreadsheet.
    • Choose 'PDF' or 'Microsoft Word 2000' for a readable-document format.
    • Choose any of the other formats if you have other needs.
  5. Click 'Go'. It will download to your computer. That's it, you're done!

To Backup via SSH

If you have SSH access, you can use the following method to create a backup of your database.

  1. SSH into your server and navigate to the document root of your site: /home/domains/
  2. Replace username, databasename, and the path to where you'd like the dump (don't put a path if you just want it in docs/) with your info, in the following command:
    mysqldump -u username -p databasename > path/to/desired/location/databasename.sql
    hit enter and enter your database password. Hit enter again.
  3. If no error message shows up, it very probably worked.
  4. Check to make sure:
    • run
      ls path/to/desired/location
      and make sure the .sql file is there.
    • run
      less path/to/desired/location/databasename.sql
      to inspect the contents of the dump. Hit 'q' to exit.
  5. Use SFTP to copy the file to your computer if you so desire.
  6. That's it, you're done!
Tags: backup, database, phpMyAdmin, restore

You cannot comment on this entry