HostOnNet Blog

Magento move site to another domain

Looking for Linux Server Admin or WordPress Expert? We can help.

First you need to replace old domain name with new domain name in Megento database.

To see entries that have old domain name, run

SELECT * FROM core_config_data WHERE path LIKE '%base%url%';

You will see something like

MariaDB [bruno2]> SELECT * FROM core_config_data WHERE path LIKE '%base%url%';
+-----------+---------+----------+-----------------------------+-------------------------------+
| config_id | scope   | scope_id | path                        | value                         |
+-----------+---------+----------+-----------------------------+-------------------------------+
|         6 | default |        0 | web/unsecure/base_url       | https://www.old-domain.com/   |
|         7 | default |        0 | web/secure/base_url         | https://www.old-domain.com/   |
|       646 | default |        0 | web/unsecure/base_link_url  | {{unsecure_base_url}}         |
|       647 | default |        0 | web/unsecure/base_skin_url  | {{unsecure_base_url}}skin/    |
|       648 | default |        0 | web/unsecure/base_media_url | {{unsecure_base_url}}media/   |
|       649 | default |        0 | web/unsecure/base_js_url    | {{unsecure_base_url}}js/      |
|       650 | default |        0 | web/secure/base_link_url    | {{secure_base_url}}           |
|       651 | default |        0 | web/secure/base_skin_url    | {{secure_base_url}}skin/      |
|       652 | default |        0 | web/secure/base_media_url   | {{secure_base_url}}media/     |
|       653 | default |        0 | web/secure/base_js_url      | {{secure_base_url}}js/        |
+-----------+---------+----------+-----------------------------+-------------------------------+
10 rows in set (0.01 sec)

MariaDB [bruno2]>

Now you need to change the first two entry. This can be done with SQL

UPDATE core_config_data SET value = 'http://new-domain.com/' WHERE path = 'web/unsecure/base_url';
UPDATE core_config_data SET value = 'http://new-domain.com/' WHERE path = 'web/secure/base_url';

Replace new-domain.com with your new Megento Store domain name.

Megento Config file

Megento store database login and other configs in file

app/etc/local.xml

You may need to edit this file and change database name and password if changed.

Redirect Problem

After changing URL of megento installation, you may face redirect issue. This can be fixed by deleting all files in folder

var/cache

Just rename cache folder, create new cache folder with 777 permission so megento can write to it.

Error logs

var/report/system.log

Posted in Installation

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.