cancel
Showing results for 
Search instead for 
Did you mean: 

move magento 2.2 to new server

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

move magento 2.2 to new server

I hope I can get some help with this issue.

I move Magento to a production server. I moved all the files to new server change the permission change the url checked in the database it was changed. I cleared the cache

did upgrade, compile, deploy and reindex and its still redirecting to the old server. Is there anything else missing. Hopefully, soon I can do the whole integration so I don't have this issues again.  Please let me know what else I'm missing.

9 REPLIES 9

Re: move magento 2.2 to new server

Hi @bigd46,

 

When you get the redirection?

I mean, when you click on some link or the first load is redirected?

Re: move magento 2.2 to new server

when I first try to go to it, it redirects 

Re: move magento 2.2 to new server

First run command from your magento instance root path,

rm -rf var/
rm -rf generated/code
rm -rf generated/metadata

Kindly Run below query from your database table core_config_data,

SELECT * FROM `core_config_data` WHERE `path` LIKE '%base_url%'

Check any entry have old URL or not if old URL replace with new URL and Clear Cache and Check it.

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: move magento 2.2 to new server

guess you didn't read. All that's been done. Still redirects 

Re: move magento 2.2 to new server

Hi @bigd46

 

Well looking at the thread - i know you have done all the possibilities still here adding two points can you please confirm on that ?

 

1) Have you changed secure and base_secure both the url from core_config_data table ? if anything missing there , then chance should be a redirect 

 

2) could you please confirm that you have change database details ? in env.php file ?

 

P.S - this is just suggestion , you might have done this still confirm !  

if issue solved,Click Kudos & Accept as Solution

Re: move magento 2.2 to new server

Yes, I have look at it a lot. I have done it a few time just make sure and checked the database.

Re: move magento 2.2 to new server

Hi @bigd46,

 

Maybe you can share some data by Private message?

I guess I would check some of these things:

  1. Right DNS configuration if the domain is the same.
  2. .htaccess if you are using Apache.
  3. core_config_data also (taking care of store level configuration)

As I said, I would start from there. If you are right about the steps you've followed it seems isn't Magento where the redirect is happening.

Re: move magento 2.2 to new server

Yes, it is something within Magento that making a redirect to the Development server. Here is what I did is copied Phpmyadmin into the same directory as Magento is on the production server and it does not redirect. I copied Phpmyadmin from the development server to the production and it doesn't do it. The other thing I did was I went into Magento and changed to it to the production URL and then copied and database and still redirects.  I just had a thought what about Redis. I am running that on the development server.

Re: move magento 2.2 to new server

I believe this is problem is cost by the multiple store view, I got the same issue while I trying to moving to my production domain. Try this

SELECT * FROM `core_config_data` WHERE `scope_id` = 1 

you should be able to see there are few more url under the value, and make sure they are point to the correct domain.

thank you

ken