Work:Exporting Databases
From Zoelife4U Wiki
Contents |
MySQL
Exporting One Database
5.0 to 5.0
One database is easy, we'll likely always want to add the --add-drop-table switch to prevent errors, since this is a backup, this will hopefully never be used, right? ;-)
mysqldump --add-drop-table -ucpanelusername -pcpanelpassword username_dbname > ~/backup.username.dbname.`date +%Y-%m-%d;`.sql
Exporting All Databases
5.0 to 5.0
All databases are even easier, but we'll want to start fresh with the databases as well as the tables...
mysqldump --add-drop-table --add-drop-database -ucpanelusername -pcpanelpassword --all-databases > ~/backup.username_alldbs.`date +%Y-%m-%d;`.sql[[Category::PostgreSQL]]