How to apply the Magento 2 patches?

Most of Magento developer want to know exactly how they should apply the security patches on their websites

in this article we are going to talk about *.patch files

There are two ways to do this

1- using  git command

git apply patch_filename.patch


2- using patch command

patch -p1 < patch_filename.patch


I hope this will be useful for you


Backup and Restore Database SSH

in this wiki we have  Backing up and restoring  Database from local server and external server,

Backup Database

Backup from local server

mysqldump -u{username} -p{passoword} {database} | gzip > {path}/backup_filename_$(date +%F).sql.gz

Backup from external server

mysqldump -P {port} -h {host} -u{username} -p{passoword} {database} | gzip > {path}/backup_file_name_$(date +%F).sql.gz

Backup specific tables

mysqldump -u{username} -p{passoword} {database} table1 table2 > {path}/table1_table2.sql


Compress & Extract

To compress one file or folder to a tar file:

tar -cvf xxx.tar file

To extract a tar file:

tar -xvf file.tar

To compress one file or folder to a tar.gz file:

tar -cvzf xxx.tar.gz file

To extract a tar.gz file:

tar -xvzf file.tar.gz

To compress one file or folder to a tar.bz2 file:

tar -cvjf xxx.tar.bz2 file

To extract a tar.bz2 file:

tar -xvjf file.tar.bz2


Subscribe to SSH