How to backup a mySQL Database through SSH on GoDaddy Dedicated Server

I rarely post these types of articles but I spent way to long searching for this content earlier today. It’s sometimes a bit shocking when you run into a question or issue and somehow Google doesn’t give you the correct answer within seconds of a search. Crazy to think that sometimes we actually need to dig threw forums and blogs in search of a solution. I’ve been dealing with some server migrations lately and I’ve run into a database backup issue. The scenario is, I’m unable to log directly into my Plesk control panel to access my phpMyAdmin panel.  I’m in the process of moving a number of sites from one server to another and I need to get a backup copy of a database. Without phpMyAdmin access or the “CMS mySQL backup method” that works for Joomla and WordPress (see below) it’s difficult to make this happen.

The solution, after searching for a while is this: You must backup the database first through SSH and then next FTP the .sql file down to your computer. To som,e this may make complete sense and be a no-brainier. For me, it took a little troubleshooting given my server situation.

Here is the line of code that took me about 2 hours to find:

mysqldump dbNameHere -udbUserNameHere -pdbPasswordHere >  //var/www/vhosts/domainname.com/httpdocs/file.sql

the //var/www/vhosts…. is specific to godaddy dedicated servers (I think) so you may need to find out the correct path for yours. Once the file.sql is created you can FTP the file down from the server.

CMS mySQL Database Backup Method

The majority of the websites that I build and work with are either Joomla or WordPress. Unlike some older platforms (osCommerce) both of these platforms have backup plugins that make database backups a snap. Akeeba for Joomla and wp-DB-Backup for WordPress are my two plugins of choice. Both will let you send the backup files off-site and it’s fairly easy to setup and automated backup to be ftp’d or emailed to a specific account.

Author: boomer

Share This Post On