Prestashop migration - broken URL, bad redirect, and can't reset admin password / access back-end office

thejoelhansen picture thejoelhansen · Dec 6, 2011 · Viewed 12.6k times · Source

So I have a local copy of prestashop (~Sites/shop) and my /etc/hosts set up so that 'localhost/shop' lets me develop on it. I'm ready to push it to the server, where its temporary spot is (http://66.206.84.189/~walnutci/shop). It isn't an entire site, just the shop sub-pages. The main site content will need to be static, so I need this contained within the 'shop' folder.

I tarred the thing up, moved it into my /shop subfolder, created an empty database of the same name as my local copy with a identically named user and permissions, imported the database (so I shouldn't have to mess with config/settings.inc.php) and...

Home page redirects me to localhost/shop, my local copy. So, I go try to log in to change it in Preferences > SEO&URL and http://66.206.84.189...hop/adminfolder properly forwards me to back-end log in. However, it's not taking my admin email and password. Same database != same credentials? I updated it with

UPDATE ps_employee SET passwd = md5('7uSpY718uKjnAOOH367gbVzzjm5StzLyfIBpSDsdI5FwxVq84UD4tPdMpassword') WHERE email = '[email protected]';

and zilch. I hit Enter at it refreshes the page, ignoring my input. The URL displays the email address I'm trying to log in with, but no red error. If I put in garbage for the password it throws the proper error "wrong password". My password, and manually updating it in the database work fine locally.

So, am I manually updating my admin password wrong? Can I hard-code the site URL somehow? I thought by keeping the folder names the same and using my Apache /etc/hosts I wouldn't run into any redirection errors (Friendly URLs are turned off, so there is no .htaccess anywhere).

Running 1.4.6.2. Mac OSX 10.7.2 locally, server is CentOS 5.7.

Thank you so much. I threw up a post to Prestashop a while back, kept looking over the weekend, and still haven't figured it out. Appreciate any ideas / insight.

Answer

S. A. Malik picture S. A. Malik · Oct 20, 2012

It is quite late for an answer, but i hope it will help someone else.

Prestashop is coded to pull the "site URL" attribute from its database when a request is served and then redirects to that shop URL, if you have moved the database and site to new a server, you need to change the 'site URL" value. To do so access your database, I use phpmyadmin.

Go to table named ps_shop_url and change the entries for domain and domianssl accordingly. This will change the site URL constants value to your current URL.

note: ps_ is the database prefix for prestashop.