0

I could not make Magento 2 work on a new server by copying the backup and DB and installing all required software. No links working for me from the homepage, as if something wrong with rewriting, and I could not find why yet. I made a new install in another directory and it is working.

What is proper procedure of migration of Magento setup to another server?

1
  • You have to provide more detail about what's the error condition. Did you clean the caches and rerun all crons? What's wrong with the links, which error code and output do they return? – ooxi Jun 5 '17 at 19:52
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.

3
  • Also if migrating the previous file system and not just the database ensure that the sessions and cache are purged as well. – Eirik Jun 7 '17 at 1:25
  • Many thanks, I will try your suggestions regarding my installation, and thank you for comprehensive answer regarding migration! :) I will accept your answer as correct, many thanks! :) – Leech Jun 7 '17 at 8:53
  • You're welcome! I'm glad, it' help you out. :) – biolauri Jun 10 '17 at 13:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.