Jump to content

how to migrate prestashop from main domain to subdomain?


CM1992415

Recommended Posts

Hi.

I want to upgrade my prestashop version.

But I want to upgrade with old website living.

So, I made subdomain and I will backup website and paste to subdomain folder & upgrade in subdomain.

After upgrade and customization I will replace to main domain

So, I backed up old website and pasted to subdomain folder.

But Whenever I entered the subdomain in browser address bar, it always displayed main domain and old website.

Kindly make me understood.

Regards.

Link to comment
Share on other sites

In Administration Preferences -> SEO - URL
Set Store URL -> change domain, ssl domain and Basic URI

domain: mydomain.com

domain ssl: mydomain.com

basic uri: /subdomain/

Link to comment
Share on other sites

3 hours ago, Guest said:

In Administration Preferences -> SEO - URL
Set Store URL -> change domain, ssl domain and Basic URI

domain: mydomain.com

domain ssl: mydomain.com

basic uri: /subdomain/

thanks.

but if I changed base url, main domain would be inactive?

I want my old website live while upgrading and customizing new one on subdomain.

is that possible?

Link to comment
Share on other sites

17 minutes ago, Knowband Plugins said:

No, Database of the main domain & sub domain should be different so there will not be any impact on the sub domain.

 

I am a newbie of prestashop.

I backed up old website and database.

And I pasted to subdomain folder and exported sql file to build database for sub.

But when I entered subdomain, 500 error occurs.

https://prnt.sc/rzbl3p

 

Link to comment
Share on other sites

domain = database 1

subdomain = database 2

1. open subdomain folder/app

2. edit parameters.yml

* change db_name, db_user, db_passs from database 2

3. save parameters.yml

4. login to subdomain admin (according to your hosting settings)

eg. subdomain.mydomain.com/admin

or

mydomain.com/subdomain/admin

change admin to your admin folder name from ftp subdomain/admin12345

5. go to Administration Preferences -> SEO - URL
Set Store URL -> change domain, ssl domain and Basic URI

6. disable URL rewrite

7. save

8. enable URL rewrite

9. save

10. go to Advanced Parameters -> Performance and clear cache and force recompile template

 

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

4 hours ago, Guest said:

domain = database 1

subdomain = database 2

1. open subdomain folder/app

2. edit parameters.yml

* change db_name, db_user, db_passs from database 2

3. save parameters.yml

4. login to subdomain admin (according to your hosting settings)

eg. subdomain.mydomain.com/admin

or

mydomain.com/subdomain/admin

change admin to your admin folder name from ftp subdomain/admin12345

5. go to Administration Preferences -> SEO - URL
Set Store URL -> change domain, ssl domain and Basic URI

6. disable URL rewrite

7. save

8. enable URL rewrite

9. save

10. go to Advanced Parameters -> Performance and clear cache and force recompile template

 

oh

my parameters.yml has no content.

please contact me via skype.

live:.cid.45b55fc9e4a3611d

I want your kind help.

Link to comment
Share on other sites

https://test.trendystyle.ch/

my old website is https://trendystyle.ch/

I copied old website source to subdomain(after changing base url on backoffice panel)

i exported database and create one for subdomain website and import sql file.

of course I changed parameters.php in the path(subdomain/app/config).

but always showed 500 error.

what I have done wrongly?

 

Link to comment
Share on other sites

Did you copy /var/cache? If yes, rename it to /var/cache_old to generade a new one.  As @NPO mentioned regeneration of .htaccess is required as well. Furthermore you sometime need to delete your browser cache/cookies.

Link to comment
Share on other sites

6 minutes ago, JBW said:

Did you copy /var/cache? If yes, rename it to /var/cache_old to generade a new one.  As @NPO mentioned regeneration of .htaccess is required as well. Furthermore you sometime need to delete your browser cache/cookies.

how to regenerate .htaccess file after deleting old one?

Link to comment
Share on other sites

29 minutes ago, CM1992415 said:

but always showed 500 error.

Activate debug mode to see the error detais.

 

8 minutes ago, CM1992415 said:

how to regenerate .htaccess file after deleting old one?

Switch on and off friendly URLs in Traffic&SEO menu

 

Link to comment
Share on other sites

14 minutes ago, JBW said:

Activate debug mode to see the error detais.

 

Switch on and off friendly URLs in Traffic&SEO menu

 

oh, please kindly help me.

I want to upgrade my prestashop version from 1.75 to latest. But if I click upgrade button, all customization will be broken and my shop not living.

So I have to migrate my website to subdomain and upgrade there and after all customization fix and transfer to main domain.

I use Plesk hosting service.

Before copying website, I changed shop domain and ssl domain capable for subdomain.

before:

Shop domain: www.trendystyle.ch

SSL domain: www.trendystyle.ch

base url: /

after:

Shop domain: test.trendystyle.ch

SSL domain: test.trendystyle.ch

base url: /

and I used website copy functionality in Plesk so that I finished transfer all source of old website to subdomain folder.

and I exported database and got sql file and created new database for subdomain website and imported sql file.

as you said, I changed name of the folder(var/cache) to cache_old and deleted .htaccess in subdomain folder(test.trendystyle.ch).

But I can not go into the backoffice panel(test.trendystyle.ch/Backoffice) and it always shows 500 error.

live:.cid.45b55fc9e4a3611d(skype id)

I am waiting for you and your kind help.

regards.

 

Link to comment
Share on other sites

1 minute ago, CM1992415 said:

But I can not go into the backoffice panel(test.trendystyle.ch/Backoffice) and it always shows 500 error.

As said activate debug mode (in file /config/defines.inc.php) to see the details

Link to comment
Share on other sites

Did you edit the .../app/config/parameters.php to point to the new database, user and password?

If everything looks correct but it sill does not work check the write permissions on your directories.

And Debug mode !

Link to comment
Share on other sites

Quote

[PrestaShopDatabaseException]

Table 'prestashop_0.prstshp_shop_url' doesn't exist
 

SELECT s.id_shop, CONCAT(su.physical_uri, su.virtual_uri) AS uri, su.domain, su.main FROM prstshp_shop_url su LEFT JOIN prstshp_shop s ON (s.id_shop = su.id_shop) WHERE (su.domain = 'test.trendystyle.ch' OR su.domain_ssl = 'test.trendystyle.ch') AND s.active = 1 AND s.deleted = 0 ORDER BY LENGTH(CONCAT(su.physical_uri, su.virtual_uri)) DESC


at line 769 in file classes/db/Db.php

764. if ($webservice_call && $errno) { 765. $dbg = debug_backtrace(); 766. WebserviceRequest::getInstance()->setError(500, '

 ' . $this->getMsgError() . '. From ' . (isset($dbg[3]['class']) ? $dbg[3]['class'] : '') . '->' . $dbg[3]['function'] . '() Query was : ' . $sql, 97); 767. } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) { 768. if ($sql) { 769. throw new PrestaShopDatabaseException($this->getMsgError() . '<br /><br /><pre>' . $sql . '</pre>'); 770. } 771. 772. throw new PrestaShopDatabaseException($this->getMsgError()); 773. } 774. }
		

		

DbCore->displayError - [line 385 - classes/db/Db.php] - [1 Arguments]

DbCore->query - [line 613 - classes/db/Db.php] - [1 Arguments]

DbCore->executeS - [line 345 - classes/shop/Shop.php] - [1 Arguments]

ShopCore::initialize - [line 119 - config/config.inc.php]

require - [line 27 - index.php] - [1 Arguments]

Looks like your DB copy was wrong or you are using different table suffix

Link to comment
Share on other sites

3 hours ago, JBW said:
Quote

[PrestaShopDatabaseException]

Table 'prestashop_0.prstshp_shop_url' doesn't exist
 

SELECT s.id_shop, CONCAT(su.physical_uri, su.virtual_uri) AS uri, su.domain, su.main FROM prstshp_shop_url su LEFT JOIN prstshp_shop s ON (s.id_shop = su.id_shop) WHERE (su.domain = 'test.trendystyle.ch' OR su.domain_ssl = 'test.trendystyle.ch') AND s.active = 1 AND s.deleted = 0 ORDER BY LENGTH(CONCAT(su.physical_uri, su.virtual_uri)) DESC


at line 769 in file classes/db/Db.php

764. if ($webservice_call && $errno) { 765. $dbg = debug_backtrace(); 766. WebserviceRequest::getInstance()->setError(500, '



 ' . $this->getMsgError() . '. From ' . (isset($dbg[3]['class']) ? $dbg[3]['class'] : '') . '->' . $dbg[3]['function'] . '() Query was : ' . $sql, 97); 767. } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) { 768. if ($sql) { 769. throw new PrestaShopDatabaseException($this->getMsgError() . '<br /><br /><pre>' . $sql . '</pre>'); 770. } 771. 772. throw new PrestaShopDatabaseException($this->getMsgError()); 773. } 774. }
		

		

DbCore->displayError - [line 385 - classes/db/Db.php] - [1 Arguments]

DbCore->query - [line 613 - classes/db/Db.php] - [1 Arguments]

DbCore->executeS - [line 345 - classes/shop/Shop.php] - [1 Arguments]

ShopCore::initialize - [line 119 - config/config.inc.php]

require - [line 27 - index.php] - [1 Arguments]

Looks like your DB copy was wrong or you are using different table suffix

I copied database rightfully.

And I can enter Backoffice via using www prefix(ex: www.test.trendystyle.ch/Backoffice).

I changed shop domain and ssl domain to subdomain.

and in maintenance I switched enable shop on.

but www.test.trendystyle.ch is infinite progressing(now showing frontend). 

please kindly tell me the reason of this issue.

Edited by CM1992415 (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...