We deploy Magento sites all around the place and often we did not setup the hosting environment, are limited to what we can do on the hosting environment or just plain forgot to change the domain name locally in the database before we backed up the database to deploy.
As you all know, or have stumbled across thisÂ post because you’re having an issue, Magento sets the domain name in the database for the base_url and the secure_base_url. If these are set to something different than the domain you are deploying the site to, it will redirect off to that domain. Simple.
So we are assuming you have restored a Magento database to a server and just need to change the base [...]
A lot of developers who are new, or have been mainlyÂ doing specialised development (eg just front end or backend) have not had to restore databases before. Or if they have they are able to use MySQL WorkbenchÂ which helps significantly with database administration.
The problem comes when you’re using a remote server which only has SSH access or the backup of the database is too big to open in MySQL Workbench to execute and restore the content.
So what do you do? Basically the same process of creating a database in MySQL Wordkbench or phpMyAdmin can be replicated from the command line easier than you think.
We assume you have MySQL installed and know the root [...]