Jump to content

From host to local


Recommended Posts

Hoi prestashoppers,

 

hope that somebody can help me. Tried the dutch forum, but it does not work.

I read a topic about going from host to local ( if you understand Dutch, do not be afraid here is the topic http://www.prestashop.com/forums/topic/159870-hele-webshop-kopieren-naar-een-ander-domein/ ).

 

That means:

I copied all the files from host to local (site + PS).

Exported the database from host via phpmyadmin.

Made a new database on the local side and imported the host database into this new one.

Changed the settings in the /config/settings.inc.php on the local side.

Tried to login in the BO of the shop, but that doesn't work.

Every time I get an error message telling me that the employee does not exist or that the password is not correct.

 

So followed the instructions mentioned in a topic concerning that you could not login any more in theBO.

Followed these instructions but keep having the same error message.

 

Is there somebody who can help me please??

You can follow the whole thread here (if you understand Dutch): http://www.prestashop.com/forums/topic/204778-ps-van-host-naar-lokaal/page__gopid__1011383#entry1011383

 

Can somebody please help. Am stuck for about a week now.

 

thnx,

jef

Link to comment
Share on other sites

Hi,

 

try to get a new password using feature "Lost password?". If your localhost don't sends email, you can temporarily modify file "your_admin_access_point/password.php":

 

 

......
$pwd = Tools::passwdGen();
$employee->passwd = md5(pSQL(_COOKIE_KEY_.$pwd));
$employee->last_passwd_gen = date('Y-m-d H:i:s', time());
$result = $employee->update();
print_r($pwd); die('   <--- dont forget to delete me');
.....

 

Regards

Edited by Alexander Simonchik (see edit history)
Link to comment
Share on other sites

Hoi Alexander,

thnx for your reaction,

Sorry but I am not that good in php. But do I have to put your text into the /config/settings.inc.php?

Did some googling and it could be that the hash ( mD5) could be the cause.

As advice they mention to go into the database, look for ps_employee and there copy the cookie key immediately followed by the new password. I tried it, but did not work.

 

So my next question goes as follows: "where can I find "my_admin_acces_point/password.php"?

I noticed a password.php in the admin map of the PS. But it also says: " Do not edit or add to this file if you wish to upgrade PrestaShop to newer versions in the future."

Or this is probaply the wrong file, I guess.

grtz,

jef

Edited by jefgees (see edit history)
Link to comment
Share on other sites

Hi, again

 

You've found the right file. The simpleast way to restore the password for admin access is to use the password recovery function. But if you are working on localhost, then you may have troubles with sending emails to your email. The code above should be temporarily inserted into the file my_admin_acces_point / password.php, then you should use the password recovery function. You'll see your new password that is not encrypted into md5. After you copy or remebmer it the changes in your password.php should be removed.

Link to comment
Share on other sites

Hoi Alexander,

 

thanks a lot for reacting.

 

Alexander you said that I have the right file. All I can see is:

 

require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated();

Tools::redirect('index.php?controller=password'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');

 

As I do not know that much of php, where do I have to put your:

 

$pwd = Tools::passwdGen();
$employee->passwd = md5(pSQL(_COOKIE_KEY_.$pwd));
$employee->last_passwd_gen = date('Y-m-d H:i:s', time());
$result = $employee->update();
print_r($pwd); die('   <--- dont forget to delete me');

 

maybe I forgot, but the version of PS is the lates (1.5.2)

 

grtz,

 

jef

Edited by jefgees (see edit history)
Link to comment
Share on other sites

Hoi elpatron,

 

whooowh many reactions. Thank you all.

 

elpatron in the config/settings.inc.php I only changed the 4 first lines

 

<?php
define('_DB_SERVER_', 'localhost');
define('_DB_NAME_', 'shop');
define('_DB_USER_', 'root');
define('_DB_PASSWD_', 'xxxx');
define('_DB_PREFIX_', 'ps_');
define('_MYSQL_ENGINE_', 'InnoDB');
define('_PS_CACHING_SYSTEM_', 'CacheMemcache');
define('_PS_CACHE_ENABLED_', '0');
define('_MEDIA_SERVER_1_', '');
define('_MEDIA_SERVER_2_', '');
define('_MEDIA_SERVER_3_', '');
define('_COOKIE_KEY_', 'KuLHvRbdZPungYRQkSnuxoGxnfxE2wgTNntmj0SRXhmkGdtv7WkQtGCy');
define('_COOKIE_IV_', '5ZEYwYwn');
define('_PS_CREATION_DATE_', '2012-10-26');
define('_PS_VERSION_', '1.5.2.0');
define('_RIJNDAEL_KEY_', 'syKAWOABu4nEYLWqkCxDVNLSjbOFdWgA');
define('_RIJNDAEL_IV_', 'LteH4FZqYk2jUvy3rNEvgw==');

 

The rest, I did not touch.

 

grtz,

jef

Link to comment
Share on other sites

Hoi Alexander,

 

Do not know what you mean with acces point.

After I imported the database and changed the settings inthe above mentioned config/settings.inc.php.

I go in my browser to:

localhost/mysite/shop(=name of the PS)/adminxxx

Then I get a log screen where I have to fill my e-mail adres and password.

And here it goes wrong.

 

In the contrary the same settings for logging in by the host: they work well.

 

hope it is good info???

 

grtz,

jef

Edited by jefgees (see edit history)
Link to comment
Share on other sites

All I can see of code is the following:

 

require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated();
Tools::redirect('index.php?controller=password'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');

Link to comment
Share on other sites

All that I've read so far is working for an existing site by the host.

Due to a crash, I copied evrything to my local disk.

I exported the database that was on host and then reimported it to my local server (XAMPP)

And did the necessary changes on order to reach the database in MySQL.

Via phpadmin I can reach this database.

But if I try to log in via browser ... that is where I get the error message

Edited by jefgees (see edit history)
Link to comment
Share on other sites

Sorry for my carelessness. You are use 1.5.x.

Then the file should be there: localhost/mysite/shop(=name of the PS)/controllers/admin/AdminLoginController.php. Needed function is processForgot():

 

 

$pwd = Tools::passwdGen();
$employee->passwd = md5(pSQL(_COOKIE_KEY_.$pwd));
$employee->last_passwd_gen = date('Y-m-d H:i:s', time());
....

// Update employee only if the mail can be sent
$result = $employee->update();
print_r($pwd); die(' <--- dont forget to delete me');

Edited by Alexander Simonchik (see edit history)
Link to comment
Share on other sites

Hoi elpatron,

just tried it. First had to read the long list of comments. The tip concerning the quotes was ok. Could see the color change.

But no result.

 

Do not know if it can be usefull, but this was the code I inserted:

UPDATE `ps_employee` SET passwd = md5('E89343C64BF0CF3292C66184B45903FC16F89E29nimda') WHERE email = '[email protected]';

The only message I got was:

Weergave van records 0 - 0 ( 1 totaal, query duurde 0.0021 sec)

 

And there is the error message again.

 

getting hopeless ...

Edited by jefgees (see edit history)
Link to comment
Share on other sites

Hope there is a solution.

May be it's not so smart the way I am thinking,

but ...

could it be possible to change in the database the links that are used to set up the prestashop.

If it exists and I can change this to localhost, then may be I can see the shop already on the screen.

Then as a visitor I can subscribe and fill in a password (that matches mine).

Then like said earlier copy the md5 and paste it in ps_employee ...

 

Or is this too simple??

 

What do you think.

Problem of course is to find the place where those links are stored.

Edited by jefgees (see edit history)
Link to comment
Share on other sites

On the previous page I sended you also some info.

When i NAVIGATE TO THE FO, I get a 404

but I do see part of the background and some colors and the menu bar.

When I click on the menu bar i am send to the right page (send me to the host page).

i think this is because as mentioned in th previous page I have not changed the links yet.

So may be if I could find the place in the database where those links are stored ...

may be ...

may be ...

 

or am I just dreaming???

Link to comment
Share on other sites

if you change something please tell us what value you changed it to.

  • the shop url would be localhost, yes?
  • the uri (this is important) is the name of the folder you placed your remote site on local, yes?
  • also using phpmyadmin set PS_REWRITING_SETTINGS to 0

 

soon I will ask you to fedex your laptop...to Alex or dh...jajajajaja

Link to comment
Share on other sites

the shop url is "localhost/alvoge/Shop

 

These are settings that you give in when you are in the BO of PS.

 

The url on the host is "http://www.alvoge.nl/Shop"

It is still under development. I do this for my [spam-filter]. (She is very lucky to have me ..and you all ... if we can find a solution ;-D )

 

and the last thing you mentioned needs more explication:

what do you mean with the syntax PS_REWRITING_SETTINGS to 0

 

BTW is the syntax for the for updating the password allright???

Edited by jefgees (see edit history)
Link to comment
Share on other sites

you didn't tell us what the uri was in shop_url, this needs to be the same as your ps folder on your localhost

 

PS_REWRITING_SETTINGS, see your mysql db...this tells ps to use friendly url's, unless you have mod rewrite turned on in your localhost...the fo won't work proplery...if it's 1 then set to 0

 

and rename your .htaccess file to backup

Link to comment
Share on other sites

Hoi elpatron,

 

friendly url's is ok.

The map that I use locally is called the same as used on the host.

I just made adjustments to get into the database. I did that in /config/settings.inc.php

 

And what i did not get is rename your .htaccess file to backup

May be stupid to ask, but how do you do this?

On the host I could do this by logging in to the control panel and then sync the .htaccess file

And that worked perfect.

Just here with XAMPP I have no idea how to do this.

Do you have any tip?

Link to comment
Share on other sites

Thanks Alexander for still remembering me.

Late last night or do you say early this morning --> Started from scratch again.

Also installed XAMPP and configured it again (no problem got excercise)

Exported the database on host.

Via ftp dowloaded all the files from the host.

This morning (normal time) imported database after deleting the text just to "Tabel structuur voor tabel `ps_access`".

Changed the first 4 lines in config/settings.inc.php

And ...

still the same.

The .htaccess file --> got a little bit confused with elpatron's tip.

As the server is running here locally I do not think there is a way to "sync" like you do on the host.

So backupped the .htaccess file and made a new one. I installed PS in a folder, so my .htaccess file is under the map Shop and not in the root of my site (info)

Even did that. But .... in PS i can "generate" the .htaccess file. As I can not get into the program, I wonder how I can do this (may db??)

No change, everything is still the same.

 

I believe I am not the first one (and sure will not be the last) who is copying from host to local.

I think it must be possible.

Or I am doing something serious wrong. Just till now, can not figured out what.

 

Thank you all for trying to help me. I do appreciate it enormously.

 

thnx,

jef

 

P.S.: elpatron basic URI is /Shop/ (on local and on host)

Edited by jefgees (see edit history)
Link to comment
Share on other sites

hmeuh want to do this,

but as I mentioned earlier this site is already alive (www.alvoge.nl ) the Shop is still in progress and is supposed to be online very soon. I hope If I can get this problem solved, because I do not like to work directly on the server (hosting).

I like to work everything out locally .. and then go for real live interenet

Hope you can feel with me???

 

You can see already part of it www.alvoge.nl/Shop

Link to comment
Share on other sites

You're right ..

but I do not want to have problems. That why I like to try things first locally and then go live.

I want to try the paymodule SISOw. Read on the internet that there are sometimes problem (most of hem=layout).

 

i also know that my hosting is not making a backup. I have to do that myself.

 

I think that you know prestashop inside and outside. So I guess when you are talking about a vanilla install that I have to install another PS in another map on the local site.

I did and guess...

everything was ok till the moment came to configure the shop:

  1. Create settings.inc file ok
  2. Create database tables ok
  3. Create default shop and languages ok
  4. Populate database tables ok
  5. Configure shop information then after 45 % --> an error occured during installation.

So I think its better to find out why there is an error. Try to do my best.

 

be back soon

Edited by jefgees (see edit history)
Link to comment
Share on other sites

You now Purphy's law??

...

Found this article:

How to regenerate a password and update the database manually?

 

There are cases when PrestaShop will not recognize your e-mail or password when connecting, and nothing happens when you ask for a new password. There can be a number of reasons for this, but the important thing is to be able to log in again. This is will require you to access your database, using phpMyAdmin for instance.

You will have to follow the following procedure:

  1. Open the /config/settings.inc.php file, from your shop's root directory. Find the line containing "COOKIE_KEY". Copy the cookie content (without the quotes): it is the MD5 for your original password.
  2. You now need to generate a new MD5 hash for your password:

    1. Go to md5.fr
    2. Paste the cookie content in the text-field, and right after it, add your desired password. For instance, xykxB41JrEacRIoZxDioPNRmKeuO3ixCLygNxBAkeOkAHf2YUVESuT9jMYPASSWORD, where the cookie ends with T9j, and the desired password is MYPASSWORD (it can be anything you want).
    3. Click on "Convertir en MD5": this will produce a MD5 hash of the text-field's content. Copy it.

[*]You now need to put this hash into your database:

  1. Open you shop's database using phpMyAdmin. If you don't know how to use phpMyAdmin, ask your webmaster, or your host.
  2. Open the "pw_employee" table, find the row corresponding to your account (it should feature your firstname, lastname, and e-mail address), click its "Edit" button.
  3. Find the "passwd" field, and paste in the MD5 that you just generated.

[*]Log in in your back-office with the email listed in the same table, and the desired password that you used above (MYPASSWORD). This will generate a new cookie key.

If it still doesn't work, open the /config/settings.inc.php file and check the value of the "PS_BASE_URI" variable. It should contain the shop's file path:

  • If your shop is at the root of the server, this variable should contain "/".
  • If your shop is in a sub-directory, it should contain it. For instance, if it's at http://www.mywebsite/shop/", then the variable should contain "/shop/".

If all fails, contact the PrestaShop support team.

 

grtz,

jef

Link to comment
Share on other sites

As promised …. Here I am back.

Thanks to the advice of elpatron ;-), I spent practically the whole week trying to find what is finally going wrong.

Do not mean it in a bad way. Learned a lot from this struggle to find out where it possibly could go wrong.

 

Did 3 formats on the local desktop.

Installed 3 different OS (2 WIN XP HOME + 1 WIN XP PRO).

Installed 3 different virus scanners.

Installed 3 times the latest XAMPP (xampp-win32-1.8.1-VC9-installer).

Installed every time Prestashop 1.5.2

 

Every time I had a message on the screen saying that there was an error during installation. A red cross indicated that I had to configure shop information (????).

 

During installation the following was correct:

Create settings.inc file

Create database tables

Create default shop and languages

Populate database tables

 

And then everything goes well till we reach the 45%.

That is where the error message comes on the screen.

 

Deïnstalled XAMPP (v.1.8.1.) and installed the previous version (1.7.7) with the latest version of PS (1.5.2).

 

And guess: no problem and I did exactly the same procedure as with the latest version.

 

And that all thanks to the vanilla install. It was a wise lesson to stick with the things that are working.

 

Now see if we can get everything from host to local. Hope this will go a little bit much faster!!

 

Grtz,

Edited by jefgees (see edit history)
Link to comment
Share on other sites

Finally,

 

we are where we were when we started .....

After all this "magic hocus pocus" nothing seems to help.

Can not imagine that there is not 1 person in the world who ever tried to copy his shop from host to local AND SUCCEEDED!!!!!

 

It's frustrating.

 

The only thing I am sure of now is the fact that XAMPP v. 1.7.7 and prestashop 1.5.2 work well together.

 

If there is someone on this forum who eventually can help me ..... that would be fantastic!!!

 

grtz,

 

jef

Link to comment
Share on other sites

It works!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Can get into it. See the original store.

Just some links are not working properly (especially the menu links to sub categories.

 

Think it has something to do with the friendlu URL's.

See the right friendly url in the browser but the screen says: "Not Found" 404

 

The right sentence is:

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

Anybody who knows what this mens and how to solve it???

 

You can not imagine how 'not-frustrated-any-more" I feel.

 

Shall put the procedure on paper if there is intrest..

Edited by jefgees (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...