Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
MIgrating to new server redirects to old url
 
Nishant Gauttam
Jr. Member
 
Avatar
Total Posts:  8
Joined:  2010-12-28
 

Hello,

I tried moving magneto website from one hosting to another, also need to change the domain name. I zipped whole magento folder from old server and unzipped to new server, update local.xml file with new db details. Imported the Old Db, changed the secure and unsecure url in core_config_data table. Deleted var/cache and var/session.  Then when I run the index page it redirect it to old website ( I didnt transfer domain yet, so old domain is on old server, running magento index page redirects to old domain ). Why does it happen? Is there something in the database where old website url is mentioned OR some thing in code files where old website url is mentioned??
I even copied .htaccess file form old server. That has nothing to do with the old url.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

What happens when you install with a generic copy of Magento and point to your old (Updated) database?

Did you follow these instructions?

http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/update_site_url_in_core_config_data

 
Magento Community Magento Community
Magento Community
Magento Community
 
Design
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2011-02-22
 

Hi N,

if you check this article http://www.designmytemplate.com/blog/magento-customization/how-to-connect-a-new-magento-installation-to-old-database/ i think it will help you to solve the problem

 
Magento Community Magento Community
Magento Community
Magento Community
 
ssorin
Jr. Member
 
Total Posts:  1
Joined:  2010-12-23
 

@ Nishant Gauttam
How did you manage to work around this?

I have the same situation here and the replies don\’t help me at all.
I configured the two URL in database and the database credentials.
Can not figure out why the redirect to the old domain.

Cheers,
Sorin

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

Did you search your core_config_data table for any of your old URL’s?

If you have multiple stores there will be multiple entries.

Do you have any custom redirects in your index.php file?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jerry050321111
Jr. Member
 
Total Posts:  7
Joined:  2011-07-15
 

What happens when you install with a generic copy of Magento and point to your old (Updated) database?

Did you follow these instructions?

_____________________________________________________
royal wedding hats,msnbc news,Coach Factory Outlet Store Online News

 
Magento Community Magento Community
Magento Community
Magento Community
 
Clay S
Jr. Member
 
Total Posts:  15
Joined:  2009-10-02
 

I just got finished battling this same issue.  The problem seems to occur if you have caching fully enabled in your dev store, then you move your dev store to a new URL without disabling caching first.

I followed all of the usual steps of deleting files in var/cache/* and var/session/* and updating values in core_config_data, but no matter what, my site kept redirecting to the old URL.  I could access static non-magento files at the new domain, so I knew it wasn’t a DNS issue.  The issue was inside Magento.

I wrote a standalone script to manually clear the cache.  Put this in a file on your server and load it in a browser:

<?php
require_once 'app/Mage.php';
$app Mage::app();

echo 
"<pre>";
if(
$app != null{
        
echo "The app was initialized.\n";
        
$cache $app->getCache();
        if(
$cache != null{
                
echo "The cache is not empty. Clean it.\n";
                
$cache->clean();
        
}
}
?>
After I ran this, Magento stopped redirecting to my old URL.  This was Magento EE 1.10.1.1.
 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

It is much easier to clear cache through ssh like this

rm -rf var/cache/*

In EE you also have a full page cache directory that you may want to remove the content from

I also recommend not using your FPC on your dev site

 
Magento Community Magento Community
Magento Community
Magento Community
 
Clay S
Jr. Member
 
Total Posts:  15
Joined:  2009-10-02
 

Brent, I agree that it is easier to simply remove var/cache/*, but what I said in my post is that I did that, but it didn’t work.  The files were deleted, but I still kept getting redirected.  I know there’s a full page cache, but are those files stored somewhere else besides var/cache?  If so, where, so that I can delete those as well.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

There is also a directory called var/full_page_cache

You could delete that one

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

One last thing, you may want to look at your .htaccess and your index.php to see if there are any redirects set

 
Magento Community Magento Community
Magento Community
Magento Community
 
Clay S
Jr. Member
 
Total Posts:  15
Joined:  2009-10-02
 

Aaah, thanks, Brent!  I did not know about var/full_page_cache! That must have been what was still hanging on when I wrote my script.  .htaccess and index.php were the first things I checked.

 
Magento Community Magento Community
Magento Community
Magento Community
 
xavierbaez
Jr. Member
 
Total Posts:  3
Joined:  2011-08-31
 
Clay S - 13 September 2011 11:22 AM

I just got finished battling this same issue.  The problem seems to occur if you have caching fully enabled in your dev store, then you move your dev store to a new URL without disabling caching first.

I followed all of the usual steps of deleting files in var/cache/* and var/session/* and updating values in core_config_data, but no matter what, my site kept redirecting to the old URL.  I could access static non-magento files at the new domain, so I knew it wasn’t a DNS issue.  The issue was inside Magento.

I wrote a standalone script to manually clear the cache.  Put this in a file on your server and load it in a browser:

<?php
require_once 'app/Mage.php';
$app Mage::app();

echo 
"<pre>";
if(
$app != null{
        
echo "The app was initialized.\n";
        
$cache $app->getCache();
        if(
$cache != null{
                
echo "The cache is not empty. Clean it.\n";
                
$cache->clean();
        
}
}
?>
After I ran this, Magento stopped redirecting to my old URL.  This was Magento EE 1.10.1.1.

I execute your script and I see this:

The app was initialized.
The cache is not empty. Clean it.

I already fixed both folders manually

What should I do now?

My Admin has infinite loops

It forwards to the old domain the first time

Then after that first time, it has infinite loops

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

@xavierbaez:: The only way to ensure you cache is completely removed is to remove all your cache files from your var/cache/* folder

 
Magento Community Magento Community
Magento Community
Magento Community
 
rcastera
Jr. Member
 
Total Posts:  3
Joined:  2009-05-29
 
Clay S - 13 September 2011 11:22 AM

I just got finished battling this same issue.  The problem seems to occur if you have caching fully enabled in your dev store, then you move your dev store to a new URL without disabling caching first.

I followed all of the usual steps of deleting files in var/cache/* and var/session/* and updating values in core_config_data, but no matter what, my site kept redirecting to the old URL.  I could access static non-magento files at the new domain, so I knew it wasn’t a DNS issue.  The issue was inside Magento.

I wrote a standalone script to manually clear the cache.  Put this in a file on your server and load it in a browser:

<?php
require_once 'app/Mage.php';
$app Mage::app();

echo 
"<pre>";
if(
$app != null{
        
echo "The app was initialized.\n";
        
$cache $app->getCache();
        if(
$cache != null{
                
echo "The cache is not empty. Clean it.\n";
                
$cache->clean();
        
}
}
?>
After I ran this, Magento stopped redirecting to my old URL.  This was Magento EE 1.10.1.1.

This worked for me as well.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

This was Magento EE 1.10.1.1.

I just noticed you said EE.

For Enterprise I always delete the FPC as well

something simple like this works

rm -rf var/cache/*
rm -rf var/full_page_cache/*

You need to fool around with all the extra php code.

While developing I would turn off Full Page Cache.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2