stets Posted November 13, 2013 Share Posted November 13, 2013 Hello everyone, my company runs prestashop and I am having a bit of an issue with something. Currently we run a shop at a subdomain ( example.test.com ) we would like to migrate that same shop to a different subdomain (example2.test.com ) to retain the theme and settings but later on have different products. If my understanding is correct, I should just be able to : 1) download example.test.com 2) upload example2.test.com 3) create a new mysql db 4) export the old db and import into the new one 5) change the settings.inc.php file I have done all of this but I now receive a 'Bad SubDomain SQL query.' error on my example2.test.com any ideas? Link to comment Share on other sites More sharing options...
El Patron Posted November 13, 2013 Share Posted November 13, 2013 hi, what is your version? you are very close Link to comment Share on other sites More sharing options...
stets Posted November 13, 2013 Author Share Posted November 13, 2013 hi, what is your version? you are very close I'm using version 1.4.7.3. The reason for this is that we have a theme that works well with this version and it has never broken for us, so we keep it. Link to comment Share on other sites More sharing options...
El Patron Posted November 13, 2013 Share Posted November 13, 2013 Here is my suggestion as I did not see in your post it was done. if you are able to log into the back office on 2nd domain, check that you have set the shop domain name (url) to 2nd domain, best to copy this and put in shop domain ssl as well. if you can not access the back office then you can modify this by editing (phpmyadmin) table configuration your prefix_SHOP_DOMAIN your prefix_SHOP_DOMAIN_SSL also I have a module that will allow this using one back office (but it is very difficult to have different products by shop so I don't recommend that) Link to comment Share on other sites More sharing options...
stets Posted November 13, 2013 Author Share Posted November 13, 2013 (edited) Here is my suggestion as I did not see in your post it was done. if you are able to log into the back office on 2nd domain, check that you have set the shop domain name (url) to 2nd domain, best to copy this and put in shop domain ssl as well. if you can not access the back office then you can modify this by editing (phpmyadmin) table configuration your prefix_SHOP_DOMAIN your prefix_SHOP_DOMAIN_SSL also I have a module that will allow this using one back office (but it is very difficult to have different products by shop so I don't recommend that) I do not have access to the back office but I can access phpmyadmin. What exactly do I modify? Edited November 13, 2013 by stets (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted November 13, 2013 Share Posted November 13, 2013 using phpmyadmin table your prefix_configuration update these two fields: your prefix_SHOP_DOMAIN your prefix_SHOP_DOMAIN_SSL here put your 2nd domain name (not www as they are subdomains) note: this usually does not keep one from accessing the back office..so there may be other changes required Link to comment Share on other sites More sharing options...
stets Posted November 15, 2013 Author Share Posted November 15, 2013 (edited) using phpmyadmin table your prefix_configuration update these two fields: your prefix_SHOP_DOMAIN your prefix_SHOP_DOMAIN_SSL here put your 2nd domain name (not www as they are subdomains) note: this usually does not keep one from accessing the back office..so there may be other changes required I've found the prefix_SHOP_DOMAIN field but there is no prefix_SHOP_DOMAIN_SSL currently the Shop domain field contains 'SELECT * FROM `ps_subdomain` LIMIT 0 , 30' I've also found a field where it says 'www'. Do I edit this or add a new one? Edited November 15, 2013 by stets (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted November 15, 2013 Share Posted November 15, 2013 change config/config.inc.php /* Debug only */ @ini_set('display_errors', 'on'); define('_PS_DEBUG_SQL_', true); and reproduce the error to see if more information Link to comment Share on other sites More sharing options...
stets Posted November 15, 2013 Author Share Posted November 15, 2013 (edited) change config/config.inc.php /* Debug only */ @ini_set('display_errors', 'on'); define('_PS_DEBUG_SQL_', true); and reproduce the error to see if more information Aha! I get this Warning: Invalid argument supplied for foreach() in mysite.com/classes/Language.php on line 606 Bad SubDomain SQL query. Line 606 reads: foreach ($result AS $row) Edited November 15, 2013 by stets (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted November 15, 2013 Share Posted November 15, 2013 I was hoping that this would 'englarge' the bad subdomain issue...it did not the warning foreach is moot... ave maria Link to comment Share on other sites More sharing options...
stets Posted November 18, 2013 Author Share Posted November 18, 2013 So I've found my issue...the database was not complete. It is not complete and up to date but I have another issue it seems. The two sites are identical, but they use different mysql databases. When I try to navigate to my second site ( example2.test.com ) it takes me to the first (example.test.com) ! This is driving me crazy. Link to comment Share on other sites More sharing options...
El Patron Posted November 18, 2013 Share Posted November 18, 2013 So I've found my issue...the database was not complete. It is not complete and up to date but I have another issue it seems. The two sites are identical, but they use different mysql databases. When I try to navigate to my second site ( example2.test.com ) it takes me to the first (example.test.com) ! This is driving me crazy. ah progress! try regenerating the .htaccess for your 2nd sub domain. (you did change the shop url's under seo&url's) yes? little by little Link to comment Share on other sites More sharing options...
stets Posted November 18, 2013 Author Share Posted November 18, 2013 ah progress! try regenerating the .htaccess for your 2nd sub domain. (you did change the shop url's under seo&url's) yes? little by little Where do I find the seo and urls? Link to comment Share on other sites More sharing options...
El Patron Posted November 18, 2013 Share Posted November 18, 2013 Where do I find the seo and urls? back office-->preferences-->seo * urls... scroll down to shop domain name/shop domainname ssl these should contain 2nd shop url(s)...no www as they are subdomains Link to comment Share on other sites More sharing options...
Recommended Posts