Magento Database transfer oddity

2019-09-01 02:01发布

问题:

My situation is that I have a 1.5 GB sqldump file from my website. I took this and dumped it into virtual box ubuntu environment on a fresh copy of Magento and restored my file system. Pretty standard. But when I go to access my local copy in the browser it immediately redirects me to the live site. Also my local.xml is correctly configured for my local system. Does anyone know where in the database/phpmyadmin these values are stored? Did I miss some Apache configuration?

回答1:

Run this query to get the URLs in the DB:

SELECT
    *
FROM
    core_config_data
WHERE
    path = "web/unsecure/base_url"
OR path = "web/secure/base_url";

If cache was enabled when you attempted to access the site, you'll need to clear your cache by removing the files in var/cache & var/full_page_cache.

Also, 1.5 GB is kind of large. I always clean out logs before I transfer a DB. Usually reduces the DB to less than 600K

SET foreign_key_checks = 0;
TRUNCATE dataflow_batch_export;
TRUNCATE dataflow_batch_import;
TRUNCATE log_customer;
TRUNCATE log_quote;
TRUNCATE log_summary;
TRUNCATE log_summary_type;
TRUNCATE log_url;
TRUNCATE log_url_info;
TRUNCATE log_visitor;
TRUNCATE log_visitor_info;
TRUNCATE log_visitor_online;
TRUNCATE report_viewed_product_index;
TRUNCATE report_compared_product_index;
TRUNCATE report_event;
TRUNCATE index_event;
TRUNCATE catalog_compare_item;
SET foreign_key_checks = 1;


回答2:

Flush Cache.

Download data base and check if any entry has your live site URL( Non standard Magento coding can result in this ).

Also check your XML and code for some hard coded links.

Summary : Could be due to cache,DB entry ro some hard coded links.