Needed to restore some data from an old MySQL dump for a Magento store, but, did not want to restore the whole SQL database which would over write recent orders etc.
The plan was to create a subdomain and do a fresh install of Magento into the subdomain and then restore the database and hope to grab some of the product information.
Installing base Magento site on the subdomain worked fine. The mysql dump already had drop tables in them, however, restoring the databases were not working as the drop had issues. The drop command was having issues due to foreign keys in the database, so, we deleted all the tables manually with phpmyadmin.
Then we could restore the database fine to the new subdomain site database. This should have worked but the mysql database prefix was set to rzw0_ during the install of the test site.
Had to edit the “app/etc/local.xml” file from:
<table_prefix><![CDATA[rzw0_]]></table_prefix>
to
<table_prefix><![CDATA[]]></table_prefix>
Then, going to the site on the subdomain it looked like it was going to work, but, it redirected us to main site. There wasn’t any base URL information stored in the configuration xml files. It turns out the base URLs are stored in the database:
mysql> select * from core_config_data where value like “%www.site.com%”;
+———–+———+———-+———————–+————————————–+
| config_id | scope | scope_id | path | value |
+———–+———+———-+———————–+————————————–+
| 3 | default | 0 | web/unsecure/base_url | http://www.site.com/ |
| 4 | default | 0 | web/secure/base_url | http://www.site.com/ |
+———–+———+———-+———————–+————————————–+
Updated these records with:
update core_config_data set value = “http://sub.site.com” where config_id = 3;
update core_config_data set value = “http://sub.site.com” where config_id = 4;
Then, reloading the page worked fine on the sub domain.
Full backup and recover could have been done with:
0 responses so far ↓
There are no comments yet...
Leave a Comment