Jump to content

Site Replication issue - Resolved


Recommended Posts

Hi,

 

I am a newcomer to prestashop (our current site is osCommerce based and heavily customised). I have installed 1.5.2 on my laptop (WAMP) for development purposes before uploading it to the live server and have started customising it and adding data (I use the laptop when I'm working in other locations). However, I decided that when at home, my PC would be a lot quicker to work on, so I replicated the installation and database to WAMP on the PC.

 

However, I now can't login in to the admin (renamed) section to continue working, as it doesn't recognise the username/password!?! It works fine on the laptop!

 

Can anyone throw any light on how I can get into the admin part of the application so that I can (change the password to what it is on the laptop?) / carry on working. Also, if this is an issue with the hash being different on each server setup, is this then going to be an issue when we upload the finished product to the live server?

 

Any help would be greatly appreciated, as it's much quicker to work on the PC when at home - rather than the laptop.

 

Cheers,

Steve

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

Hi,

 

I am a newcomer to prestashop (our current site is osCommerce based and heavily customised). I have installed 1.5.2 on my laptop (WAMP) for development purposes before uploading it to the live server and have started customising it and adding data (I use the laptop when I'm working in other locations). However, I decided that when at home, my PC would be a lot quicker to work on, so I replicated the installation and database to WAMP on the PC.

 

However, I now can't login in to the admin (renamed) section to continue working, as it doesn't recognise the username/password!?! It works fine on the laptop!

 

Can anyone throw any light on how I can get into the admin part of the application so that I can (change the password to what it is on the laptop?) / carry on working. Also, if this is an issue with the hash being different on each server setup, is this then going to be an issue when we upload the finished product to the live server?

 

Any help would be greatly appreciated, as it's much quicker to work on the PC when at home - rather than the laptop.

 

Cheers,

Steve

 

Hmmm...

 

Okay now got that working (requested new password) but noticed I was correct; in that the password hash is different - so will have to remember not to export/import the employee tables.

 

However, I now have another problem - having copied all the changed files across, the website does not appear in the browser window - I just get a blank window. So, I'm now assuming there is something in the configuration files somewhere that ties the installation to the machine it's installed on.

 

Can anyone help with the location f where I need to make the edits please? This is somewhat urgent, as we really want to get this site up&running in time for the Christmas rush. I need to get all the editing and configuration done on the development server then upload to the live server (but not publicly available) for testing and configuring the payment modules before it can go live. However, I'm beginning to wonder if I'm going to have the same issues when the site is uploaded to the production server.

Link to comment
Share on other sites

OK. Looking through the Apache error logs, it seems we have the following issue:

 

[Tue Nov 20 10:43:07.791398 2012] [:error] [pid 6512:tid 804] [client 127.0.0.1:58066] PHP Fatal error: Uncaught Link to database cannot be established: SQLSTATE[HY000] [1045] Access denied for user 'xxxxxxxxxxxxx'@'localhost' (using password: YES)\n thrown in W:\\WWW\\prestashop.apnea.co.uk\\classes\\db\\DbPDO.php on line 58

 

However, I have no clue from line 58 what the password issue is I've checked that the user password on the database is the same as what's in the <settings.inc.php> file.

 

Aynone?

Link to comment
Share on other sites

Hi there, maybe you should test if the user and password is valid.

A simple script like that should do the trick

<?php
mysql_connect("localhost", "admin", "1admin") or die(mysql_error());
echo "Connected to MySQL<br />";
?>

If not setup the database priviliges until it works.

Best regards, trip

Link to comment
Share on other sites

Hi there, maybe you should test if the user and password is valid.

A simple script like that should do the trick

<?php
mysql_connect("localhost", "admin", "1admin") or die(mysql_error());
echo "Connected to MySQL<br />";
?>

If not setup the database priviliges until it works.

Best regards, trip

 

Hi Trip,

 

Thanks for the reply. I double and triple checked that the database privileges are OK and the username & password are correct (it was working fine until I copied the prestashop files over from my laptop). I'm thinking it might have something to do with certain keys that are created when prestashop is installed because I see this in the <settings.inc.php> file:

define('_COOKIE_KEY_', 'xxxxxxxxxxxxxxxxxxxxxx');
define('_COOKIE_IV_', 'xxxxxxxxxxx');
define('_PS_CREATION_DATE_', '2012-11-01');
define('_PS_VERSION_', '1.5.2.0');
define('_RIJNDAEL_KEY_', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
define('_RIJNDAEL_IV_', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');

 

It's only happened since I copied the files over

 

Edit: Forgot to mention - my thought is that these keys were different in the file that was over-written in this installation and that these keys somehow play a part in what is presented to the DB server!?!

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

Hmmmm............. Now I can't login to the admin area! and it won't send me a password reset!

 

I think I need to start taking something! This thing is giving me a headache! It was to do with the <mails> language files - I neglected to change the <en> folder to <gb>. Now it works. Still don't know why it required the password reset though, the password never changed!

Link to comment
Share on other sites

Now, the next question is, am I going to be able to just upload all the files to the production webserver and import all the database data into the production MySQL server and it all work? Or, am I going to have all these same issues every time?

 

Or, do I have to "Install" it on the production server and then go through re-doing all the modifications?

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

Hi Porpoise.

learning by doing has probably the best results and so far you are doing well. Usually there are only a few variables changing and most if not all important are in the settings.inc.php

If the cookie and rijndael keys in the config change than the password hashes and cookies from the previous installation can not work. There shouldn't be much problems when you copy your whole installation to to production server and just modify the db settings in settings.inc.php

But server configurations are complex and every hoster has it's own so when you use Rijndael with mcrypt lib but for the most unlikely case it is not compiled on the production server, than it will not work. Same goes to memcached, apc or whatever I forgot.

Usually you can disable the features than in ps_configuration table but I wouldn't start with a too fancy setup on the test installation and enable the features if desired later.

Good luck, trip

Link to comment
Share on other sites

Hi Porpoise.

learning by doing has probably the best results and so far you are doing well. Usually there are only a few variables changing and most if not all important are in the settings.inc.php

If the cookie and rijndael keys in the config change than the password hashes and cookies from the previous installation can not work. There shouldn't be much problems when you copy your whole installation to to production server and just modify the db settings in settings.inc.php

But server configurations are complex and every hoster has it's own so when you use Rijndael with mcrypt lib but for the most unlikely case it is not compiled on the production server, than it will not work. Same goes to memcached, apc or whatever I forgot.

Usually you can disable the features than in ps_configuration table but I wouldn't start with a too fancy setup on the test installation and enable the features if desired later.

Good luck, trip

 

Hi Trip,

 

Yes, I usually find trial & error are the best teachers. I learnt a lot from having to heavily modify the code and add additional functions to our osC site. Not least, the shipping functions. It's very complicated where we are based (Jersey [original]) as we have to be able to charge the local GST for local customers, UK VAT for UK customers and NO VAT for the rest of the world.

 

I'm still working on the Presta implementation but have already discovered issues with the tax calculations and I'm also seeing issues with multiple items producing split orders. Aside from the tax calculations, we also have the problem that we have different shipping methods depending on destination, weight and/or length of the package.

 

I have set up the shipping options to cater for the different categories of shipping:

 

Local Packet (Jersey) - local tax: GST= 5%

Local Parcel (Jersey) - local tax: GST= 5%

 

British Isles Packet (Non-UK) - no tax [Guernsey, Isle of Man]

British Isles Parcel (Non-UK) - no tax [Guernsey, Isle of Man]

 

European Packet (EU only) - no tax [there is no mechanism for us to collect tax for any jurisdiction other than local & UK

International Packet (ROW) - no tax

 

Various International Parcel Zones (each zone covering a different group of countries) [here there is some overlap between European & ROW but as they are all in a NO-TAX zone it doesn't really matter at this stage]

 

I've managed to set all those up - and all the accompanying rates - but I have an additional problem that the system also has to determine whether the package is in category A or category B

 

Category A is anything under 61cm long AND less than 2Kgs.

Category B is anything longer than 61cm AND/OR over 2Kgs. - in which case, the only shipping option becomes Parcel.

 

However, it seems that when adding the possible shipping method to the products that fall into each of those categories, it doesn't quite follow through to the shopping cart properly - in that if the cart contains items from both of those shipping categories, instead of only giving the Parcel option, it decides to split it into 2 orders with separate shipping?!?

 

Somehow, I have to come up with a method to accomplish everything being in a single order - regardless of other criteria - other than if the total weight goes over the maximum shipping weight. Any ideas on that would be gratefully received :)

 

I'm also going to have to modify (somewhere?) code to produce shipping/customs labels in the format they are currently produced, in order to comply with the requirements for Pre-Paid VAT for UK only orders, ROW orders and Local orders. Phew! Hard work ahead! :(

 

Cheers,

Steve

Link to comment
Share on other sites

Hmmm...... I've uploaded it to the pre-production server to test the functions before getting too carried away with loading up products/customising the look etc. but when I type in the URL, it keeps re-directing back to the "localhost" and bringing up the local installation. I figure it's got to be still picking the local URL somewhere within some configuration file or the database but I can't seem to locate where. Can anyone please point me in the right direction?

Link to comment
Share on other sites

Hmmm...... I've uploaded it to the pre-production server to test the functions before getting too carried away with loading up products/customising the look etc. but when I type in the URL, it keeps re-directing back to the "localhost" and bringing up the local installation. I figure it's got to be still picking the local URL somewhere within some configuration file or the database but I can't seem to locate where. Can anyone please point me in the right direction?

 

OK. Solved that bit - it was in the `ps_shop_url` table. However, I now can't get logged into the admin area and it won't reset the password and send me an email. Is there any other way I can reset the password to get in?

Link to comment
Share on other sites

However, I now can't get logged into the admin area and it won't reset the password and send me an email. Is there any other way I can reset the password to get in?

 

Solved that, thanks to someone's suggestion elsewhere in the forum - create customer with required password, cut and paste password in database.

Link to comment
Share on other sites

×
×
  • Create New...