Backing Up Your Database
The following only applies to those with SSH access to their own server.
Important note: This will not work for those on Bryght's shared hosted service: only customers with their own virtual private server can follow these steps. If you are using the Bryght hosted service, contact us for a backup of your site's database.
ssh yourdomain.com -l admin- if you have a different account name than 'admin', use that account. It will need 'sudo' privileges.
- replace
yourdomain.comwith the domain you have pointed to your server, or the IP address for your server. Then type in your password. - We recommend Putty for Windows users. Those on a Mac or Linux computer can use their terminal (or an open source equivalent like iTerm for the Mac).
sudo su- [type your password if necessary]
- find your settings.php file. Possible locations are
/var/www/html/sites/defaultor/var/www/html/sites/yourdomain.com cat /var/www/html/sites/yourdomain.com/settings.php | grep "mysql"- replacing the directory name as appropriate
- you should see something like:
mysql://username:password@localhost/databasename mysqldump -uYourUser -pYourPassword Datbase_Name > yourdomain.com.MM.DD.YYYY.mysql- replace
YourUser,YourPassword,Database_Nameand the date (which is useful when going through old backups) as appropriate
- replace
tar -czvf yourdomain.com.MM.DD.YYYY.tar.gz yourdomain.com.MM.DD.YYYY.mysql- again replace as appropriate
- download the resulting file at http://yourdomain.com/yourdomain.com.MM.DD.YYYY.tar.gz
rm yourdomain.MM.DD.YYYY.*- delete the files to conserve space on your server