Importing/Exporting Magento Databases

Posted by: Karen Tuesday, August 24th, 2010

Magento Databases can get pretty big. Here are some commands to help with import/export.


mysqldump -h localhost -u <username> -p <dbname> > <exportname>.sql


mysql -h localhost -u <username> -p <dbname> < <importname>.sql
e.g. mysql -h localhost -u karen -p auctionmaid < auctionmaid.sql

If you need to transfer this file off the server via the shell you can do this – see the Putty tools for downloads:

pscp <username>@<remoteip>:<fullpath_to_sql_file>.sql <local_sql_file>.sql
pscp root@ > magdb.sql

Comments are closed.