Magento 2.2.2 Site Migration to Another Server – Key Points

magento2.2.2migration

We are planning to transfer out test site to the production server.

What must we look out for? What changes ought to be made?

Best Answer

For UBUNTU/LINUX operating system follow below steps.

Step:1 apache/server settings

Run below commands in your server

sudo a2enmod expires
sudo a2enmod ssl
sudo a2enmod rewrite

Now change apache configuration. in apache2.conf file.

sudo nano /etc/apache2/apache2.conf

    <Directory /var/www/>
     Options Indexes FollowSymLinks
     AllowOverride None
     Require all granted
</Directory>

to

  <Directory /var/www/>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted 
</Directory>

now after changes you should restart apache.

run sudo service apache2 restart

change magento permission according to system user.

----Apply permission to directory only------

find . -type d -exec chmod 755 {} \;

----Apply permission to files only------

find . -type f -exec chmod 644 {} \;

step: 2 Magento settings

  1. change website mode from current to production mode, before you change mode just compile your current code

    php bin/magento setup:di:compile

  2. after success , you can change website mode

    php bin/magento setup:deploy:mode:production

  3. Set Default Robots "index,follow."

Magento 2.1.* and older version:

Go to Store -> configuration -> general ->  design ->Search Engine Robots tab and then select 'index,follow'.

Magento 2.2.*:

Go to Content -> configuration -> select/edit website row -> Search Engine Robots tab and then select 'index,follow'.
  1. add Google analytics related settings and code.

  2. create site-map.

  3. set magento cron.

  4. merge minify css and js from configuration

  5. enable all Magento cache.

  6. Admin url and password must need to be difficult.

    10.set email sending configuration

Note: Take database backup daily. :)

Related Topic