Exporting your Mysql database from the command-line at mediatemple.net

General

I killed my php on my mediatemple.net account this weekend. I wanted to upgrade my php version to /at least/ 5.4 so that I could use the new Parse.com php-sdk on the server.

My account was a DV 4.0, and there really aren’t any easy options for updating php. I contacted support and all they would do was refer me to their Pay Service. They did give me a link to a knowledgebase article for upgrading php in plesk.

Ok. I’m in.

I logged into my server via SSH, executed all the commands.. tested php from the command-line. All was good. Sweet.

I restarted apache…

Ok.. I didn’t actually restart apache. Because apache wouldn’t restart. It gave some error about an issue in the config (I can’t remember what it was at the moment).

Long story short.. and on to the title of the post. My options were paying $80 to have their support upgrade php (and hopefully sort the issue) or just finally get off my ass and move my site. Something I have been wanting to do for a while, I just never had much motivation to do so.

The good thing was all my data, both physical and digital, was safe. I just needed to transfer it all. Physical files were an easy grab, but I spent quite a bit of time thumbing through articles trying to find the right command to export my databases.

This will do it:

mysqldump --add-drop-table -u admin -p`cat /etc/psa/.psa.shadow` DATABASE > export.sql