DEV Community

Cover image for Migrate Magento code to another server
Yegor Shytikov
Yegor Shytikov

Posted on Edited on

Migrate Magento code to another server

SSH to both servers old one (server A) and a new one (server B)

you need to Copy the files legacy server A :

Archive it first

tar -czvf magento.tar.gz app/code/
Enter fullscreen mode Exit fullscreen mode

move to the public dir server A:

 mv magento.tar.gz pub/
Enter fullscreen mode Exit fullscreen mode

Go to new server B web dir. for example :

cd /var/www/html/
Enter fullscreen mode Exit fullscreen mode

Download files to the new server B:

wget https://www.{domain}.com/magento.tar.gz
Enter fullscreen mode Exit fullscreen mode

Untar files on a new serve B:

tar -xzvf magento.tar.gz -C magento
Enter fullscreen mode Exit fullscreen mode

remove a file on the old server B:

rm pub/magento.tar.gz 
Enter fullscreen mode Exit fullscreen mode

In the next step, you will need to dump Magento DB. See my other posts.

Top comments (0)