In case you have database access, and I sure hope so, you might want to use this query to update your Unsecure and Secure URL's:
UPDATE core_config_data
SET value = 'http://yournewdomain.com/'
WHERE path LIKE 'web/unsecure/base_url'
LIMIT 1 ;
UPDATE core_config_data
SET value = 'https://yournewdomain.com/'
WHERE path LIKE 'web/secure/base_url'
LIMIT 1 ;
Without any further details, I try to guess: Are your base URLs of the magento installation correct?
You could use the following commands to get the current values:
SELECT * FROM core_config_data WHERE `path` LIKE '%web/unsecure/base_url%';
SELECT * FROM core_config_data WHERE `path` LIKE '%web/secure/base_url%';
If not, you have to adjust them either directly within the database or via the console according to the official documentation on store cli commands (--base-url
& --base-url-secure
).
General migration procedure
After loading the database dump and extracting your backup, you have to set the correct database credentials in app/etc/env.php
within the installation directory.
Then, you should check the database for the following two values in core_config_data
table:
web/unsecure/base_url
web/secure/base_url
Update the filesystem ownership and permissions: Please refer to the official tutorial on filesystem ownership and the official tutorial on permissions on production and development mode.
If you want to run this installation in production, run the magento deploy:mode production
command (as magento user/magento file system owner) to delete and regenerate caches, etc. Otherwise clear them.
Last but not least: Check the Cronjobs (if you used them on your old machine.
Please refer to Khoa TruongDinh's answer to a similar question for further details.
Best Answer
For UBUNTU/LINUX operating system follow below steps.
Run below commands in your server
Now change apache configuration. in apache2.conf file.
to
now after changes you should restart apache.
change magento permission according to system user.
----Apply permission to directory only------
----Apply permission to files only------
change website mode from current to production mode, before you change mode just compile your current code
php bin/magento setup:di:compile
after success , you can change website mode
php bin/magento setup:deploy:mode:production
Set Default Robots "index,follow."
Magento 2.1.* and older version:
Magento 2.2.*:
add Google analytics related settings and code.
create site-map.
set magento cron.
merge minify css and js from configuration
enable all Magento cache.
Admin url and password must need to be difficult.
10.set email sending configuration
Note: Take database backup daily. :)