How do I export or backup a database?
Before you use either of the following methods:
- Log in to the Brownrice Dashboard
- Find your database credentials
- DB username
- DB password
- database name
To Backup/Export via phpMyAdmin
- From the Databases page, click the phpMyAdmin link and log in with your credentials.
- In the left sidebar select the databse to be exported.
- In the top menu-bar click 'Export'.
- 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.
- 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.
- SSH into your server and navigate to the document root of your site: /home/domains/examplesite.com/docs/
- 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. - If no error message shows up, it very probably worked.
- 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.
- run
- Use SFTP to copy the file to your computer if you so desire.
- That's it, you're done!