Magento How to take database and code backup using SSH command line excluding var and media folder

1. Backup Database 

Command::> mysqldump -uUsername -pPassword DBName > /var/www/projectFolderName/www/var/sqlfilename.sql

Hint:
Username - Your database user name
Password - Your database Password
DBName - Your database name
sqlfilename.sql - Database backup file name. It can be anything.
/var/www/projectFolderName/www/var/sqlfilename.sql - This is path of your server where it will be downloaded



2. Code Backup

Command::> First Go To The Root Of Your Project then execute below command
Command::> tar -czvf codebackupfilename.tar.gz www --exclude='www/media' --exclude='www/var'

Hint:
codebackupfilename.tar.gz - Code backup file name. It can be anything.
--exclude='www/media' - To exclude media folder from backup (If you want media folder then remove this line)
--exclude='www/var' - To exclude var folder from backup (If you want var folder then remove this line)
Magento How to take database and code backup using SSH command line excluding var and media folder Magento How to take database and code backup using SSH command line excluding var and media folder Reviewed by Web Technology Funda on 2:10:00 AM Rating: 5

No comments

Free! Free!Free! Subscribe to Get Free PHP (Magento) tutorial Update in Your Inbox!!! Hurry Up!!!