Jump to content

[SOLVED] - Issues cloning/mirroring a working shop


Recommended Posts

Hello all,

 

 

Currently I am having some issue cloning/mirroring my working sites ever since I moved to PS152.

It was not having problems before on the older version I was running, and since the new version remains a big quantum leap for me still, asking those of you who might have solved this problem already.

 

What I was doing before with my 1.2.5.

  • Copying all my files to the new location.
  • Syncing the working DB on the new one.
  • Wiping the .htaccess from new locaiton.
  • Updating settings.inc.php with new DB details and new location.

Up until now that was all what I had to do to be able to access the BO and change the rest from there like domain and such.

 

Now it is not working anymore. The BO login page refuse my login credentials.

 

I assume security was increased, and I am quite certain I am missing something quite obvious.

So please point it out to me ;)

 

I have now tried to change URL_CANONICAL from the DB before syncing, but that has not solved my problem and I am running out of ideas.

 

 

Thanks in advance.

 

Cheers!

Edited by Muad'Dib (see edit history)
Link to comment
Share on other sites

I did change domains on a PrestaShop install recently and created this article explaining the steps: https://support.terranetwork.net/web/knowledgebase/125/Changing-Domain-Name-on-your-PrestaShop-install.html

 

If that's not working for you, might be worth looking at other variables. For example, is the cloned site on the same server? If not, a difference in server settings could also be an issue.

 

Lastly, have you been able to check the server logs or contact your hosting provider to see if there any entries for your cloned site in the logs that would indicate where the problem is?

 

Edith

  • Like 1
Link to comment
Share on other sites

Hello Edith,

 

 

Many thanks for answering and trying to help me, much much appreciated.

 

I had read your article already, however and unfortunately it seems it was for a older version and did not help me on my current version ps 1.5.2 giving me problems with this. What was the version you moved yourself, 1.4.x maybe?

The PS_SHOP_DOMAIN is not in the ps_configuration table nor is the PS_SHOP_DOMAIN_SSL.

 

As I said I never had any kind of problems making multiple copies of my production websites before (ps 1.2.5).

I never had issues to access the BO after a move, even with partials settings set. Now it loops on the login page, just like it could not read my credentials or something.

 

I am using different domains, but it is using the same hosting, same kind of databases (even if separate) with same settings.

 

Right now I am thinking maybe something is getting encrypted somewhere which would explain why I missed it.

 

Anyone who could shed some new lights will be much appreciated.

I am quite certain it is something very obvious that I am missing, and it is annoying me lately because it prevent me from testing stuff since I cannot really do it on a production site.

 

Anyway will go back looking into this tomorrow ;)

 

And thanks again Edith, your reply was much appreciated!

 

 

Cheers!

Link to comment
Share on other sites

In version 1.5.2, the database table "ps_configuration" does hold these 2 fields:

PS_SHOP_DOMAIN

PS_SHOP_DOMAIN_SSL

 

See screenshot below taken from a fresh 1.5.2 install today:

 

12-12-13-prestashop.jpg

 

Can you confirm if these two fields contain the correct domain for your new URL?

 

NB: The prefix "ps_" may be different in your install or you may not use a prefix at all.

 

Edith

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

like the OP I had never experienced problems uploading from mylocalhost an installed ps...for 1.4 and below

 

that changed with 1.5....I ran into cache problems and got around it by modifying the db to turn off various cache settings...front office was fine...the back office...advanced parms-->performance..would take 500 error...I also found permission issues...which I never had before...

 

as this is a demo shop...and I got tired of messing around with it...I uploaded a non-installed unziped 1.5.2...I know use this to copy to other domains domain/subdomains and do my install on the remote...

 

suerte

Link to comment
Share on other sites

Many thanks for replying again and trying to help me.

 

Your answer Edith really confused me :blink:

 

Because yes I am 100% positive I do not have neither of those variables *SHOP_DOMAIN* nowhere in my PS1.5.2 Prod DB...

 

 

 

ssh$ mysqldump --host=server --databases prod-db --user=user -pdbpwd > TEMP/PROD-DB-`date +%Y-%m-%d_%H%M%S`.sql
ssh$ grep -n 'SHOP_DOMAIN' TEMP/PROD-DB-2012-12-13_181315.sql
ssh$ 

 

So you really got me thinking here, how can you have those when I do not?

 

I went a little deeper and looked for any calls of those two vars in any file of the whole prestashop 1.5.2 folder and I ended up with this:

 

 

ssh:~$ grep -rn 'SHOP_DOMAIN' ps152/*
ps152/AdminTab.php:2311:               if ($_SERVER['HTTP_HOST'] != Configuration::get('PS_SHOP_DOMAIN') && $_SERVER['HTTP_HOST'] != Configuration::get('PS_SHOP_DOMAIN_SSL'))
ps152/AdminTab.php:2313:                       $this->l('This one is different from the main shop domain name set in "Preferences > SEO & URLs":').' <span style="color: #CC0000;">'.Configuration::get('PS_SHOP_DOMAIN').'</span><br />

 

So at this point I was really really confused.... :blink: :blink: :blink:

 

The only I could think of was to look for my old-domain.tld in the DB which I did:

 

 

ssh:~$ grep -n 'www.old-domain.tld' TEMP/PROD-DB-2012-12-13_181315.sql
[thousands of irrelevant lines removed]
5370:INSERT INTO `pss_quick_access` VALUES (1,0,'index.php'),(2,1,'../'),(3,0,'index.php?controller=AdminCategories&addcategory'),(4,0,'index.php?controller=AdminProducts&addproduct'),(5,0,'index.php?tab=AdminDiscounts&adddiscount'),(6,0,'http://www.old-domain.tld/ps152/administrator/index.php?tab=AdminProductEdit');
6012:INSERT INTO `pss_shop_url` VALUES (1,1,'www.old-domain.tld','www.old-domain.tld','/ps152/','',1,1);
ssh:~$ 

 

That got me thinking again...(brain on fire with smoke and all!)

 

Then I realized when I was playing with the new installation I 'may' have clicked the multishop feature (not 100% sure but that is my best guess). Still assuming, it would have then put my shop domain in that new table ps_shop_url and removed the old vars which are probably affected properly with the method Configuration::get('PS_SHOP_DOMAIN') based on the new PS1.5.2 features.

 

Bottom line I have a new something to check when I had no leads yesterday so I love you all :wub: :wub: :wub:

 

 

I keep you posted!

 

Cheers!

Link to comment
Share on other sites

There is a new database table in PS 1.5 where you need to change the shop URL look for ps_shop_url.

 

YES EXACTLY! I just found few mins ago when looking for the other things ;)

 

Was typing my message when gave me your lead!

 

Many thanks for helping out as well much much appreciated!

 

 

Cheers!

Link to comment
Share on other sites

Just to clarify the PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL can be found in PS_Configuration table click on browse and browse through the pages and you will find them.

 

Trust me I do not have them anywhere in my current prod DB just dumped instant ago and left untouched/unedited.

 

ssh$ mysqldump --host=server --databases prod-db --user=user -pdbpwd > TEMP/PROD-DB-`date +%Y-%m-%d_%H%M%S`.sql
ssh$ grep -n 'SHOP_DOMAIN' TEMP/PROD-DB-2012-12-13_181315.sql
ssh$ 

 

The grep command looks for any occurrence of 'SHOP_DOMAIN' (which matches both *SHOP_DOMAIN & *SHOP_DOMAIN_SSL) in the given file as input, here the dump of the sql database.

No result found.

 

My best guess is it is removed when multishop gets enabled and affected afterwards with the methods when needed.

 

Going to test if those few findings will resolve my problem.

 

Copying files right now...

 

 

Will keep you all posted.

Link to comment
Share on other sites

Good news!!! ;)

 

It works! Managed to log in BO to regenerate .htaccess.

 

So far only clicked a few things and BO/FO seem to work just fine. Will require further testing to confirm if the mirroring is flawless or not. But nothing as obvious as 500 errors like elpatron experienced. So keep finger crossed here ;)

 

So I confirm again, I do not have *SHOP_DOMAIN nor *SHOP_DOMAIN_SSL nowhere.

 

All I did was:

  1. cp -r prod-folder/* new-folder/
  2. mysqldump prod-db
  3. change CANONICAL_URL from ps_configuration and the 3 fields of the ps_shop_url which contained my www.old-domain.tld and prestashop folder location.
  4. update the settings.inc.php
  5. log in BO to regenerate .htaccess.

 

 

Anyway with your help I just made a gigantic step forward, and I am really grateful for that!

 

Will keep you posted later when I have done more stress test on the mirror. Probably end of week-end, next week the later.

 

 

 

I will update the status of this thread in a few days, I still need to make sure it is solved before I mark it as being so.

Please moderators/community managers leave the thread open a little longer

 

 

Cheers!

Link to comment
Share on other sites

Well it seems it works.

 

Got no problems, no errors nothing and I spent the last 4 days testing & adjusting the mirror for my needs.

 

I validate ;)

 

Will soon make a tuto to sum this up.

 

But for now it is solved. Thanks again to all those who helped.

 

Cheers!

Link to comment
Share on other sites

That's great news! Would be interesting to read how you made it work. If you write a tutorial, please publish link in this thread.

 

Sure will do. It is already all in here, but I figured out I could sum it up in a more clear way in a separate thread so people do not have to read at us thinking out-loud lol :D

 

Cheers!

Link to comment
Share on other sites

  • 2 months later...

Good news!!! ;)

 

It works! Managed to log in BO to regenerate .htaccess.

 

So far only clicked a few things and BO/FO seem to work just fine. Will require further testing to confirm if the mirroring is flawless or not. But nothing as obvious as 500 errors like elpatron experienced. So keep finger crossed here ;)

 

So I confirm again, I do not have *SHOP_DOMAIN nor *SHOP_DOMAIN_SSL nowhere.

 

All I did was:

  1. cp -r prod-folder/* new-folder/
  2. mysqldump prod-db
  3. change CANONICAL_URL from ps_configuration and the 3 fields of the ps_shop_url which contained my www.old-domain.tld and prestashop folder location.
  4. update the settings.inc.php
  5. log in BO to regenerate .htaccess.

 

 

Anyway with your help I just made a gigantic step forward, and I am really grateful for that!

 

Will keep you posted later when I have done more stress test on the mirror. Probably end of week-end, next week the later.

 

 

 

I will update the status of this thread in a few days, I still need to make sure it is solved before I mark it as being so.

Please moderators/community managers leave the thread open a little longer

 

 

Cheers!

 

Hello,

 

can you please explain, show some screen what you did? =) I have same problem but I really dont know to do the final step, please try to explain it for really terrible prestashop user coz I am really new into all of this

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...