Jump to content

[SOLVED]move from server to localhost


Recommended Posts

Hi there

 

I`m trying to move my shop from to server to localhost. The only topic about that Ive found is http://www.prestashop.com/forums/topic/259761-move-from-server-to-localhost/ with clear instruction hot-to:

 

1) Install a fresh PS on local (so I created a DB on local)
2) Delete all tables from data-base
3) Import all the tables downloaded from your on line web-store data-base in the local data-base
4) Delete all file except folder Admin on local (with new admin number)
5) Copy all files (except folder Admin) downloaded from your on line web store server on local
6) Change the setting.inc file in folder config to show localhost and local db
7) Change in the back office the old URL to new address (localhost)
8) In the local DB in the table ps_configuration change to localhost

 

Ill explain every step in detail:

 

1) done no problems and Im able to access Back Office

2) done no problems

3) succeed took quite a while tho but can`t access BO from now on but login page shows up - just tells me username or pass is incorrect so I changed it through 

4) just left new admin folder

5) done, permissions set

6) done

7) cant do it in BO as I can`t access it but Ive changed it in phpMyAdmin in ps_shop_url

8) done

 

After all that I cant access neither BO nor FO.

 

Trying to access FO gives me:

 

Oops, something went wrong.Try to refresh this page or feel free to contact us if the problem persists.

 

 

 

 

 

Trying to access BO:

 

 

The following module(s) could not be loaded:
  1. [auctions] Error found in config file: Start tag expected, '<' not found

 

 

 

 

and below that there is panel to login but I cant login as i get wrong username/pass error.

 

 

Im in linux environment (openSUSE 13.1) with php5, apache2, mysql and all. Prestashop 1.5.6.1 both server and localhost

 

 

Thanks and I really hope someone will guide through this

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

Thanks vekia I was actually hoping for your reply.

 

After turning displaying errors on the output in FO is as follows:

 

[PrestaShopDatabaseException]

Table 'MY_LIVE_DOMAIN_NAME.ps2_shop_url' doesn't exist
 

SELECT s.id_shop, CONCAT(su.physical_uri, su.virtual_uri) AS uri, su.domain, su.main
                    FROM ps2_shop_url su
                    LEFT JOIN ps2_shop s ON (s.id_shop = su.id_shop)
                    WHERE (su.domain = '127.0.0.1' OR su.domain_ssl = '127.0.0.1')
                        AND s.active = 1
                        AND s.deleted = 0
                    ORDER BY LENGTH(CONCAT(su.physical_uri, su.virtual_uri)) DESC
at line 613 in file classes/db/Db.php

 

607.             WebserviceRequest::getInstance()->setError(500, '
 '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
608.         }
609.         else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
610.         {
611.             if ($sql)
612.                 throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
613.             throw new PrestaShopDatabaseException($this->getMsgError());
614.         }
615.     }
616.
617.     /**
  • DbCore->displayError - [line 313 - classes/db/Db.php] - [1 Arguments]
    Argument [0]
    SELECT s.id_shop, CONCAT(su.physical_uri, su.virtual_uri) AS uri, su.domain, su.main
                        FROM ps2_shop_url su
                        LEFT JOIN ps2_shop s ON (s.id_shop = su.id_shop)
                        WHERE (su.domain = '127.0.0.1' OR su.domain_ssl = '127.0.0.1')
                            AND s.active = 1
                            AND s.deleted = 0
                        ORDER BY LENGTH(CONCAT(su.physical_uri, su.virtual_uri)) DESC
  • DbCore->query - [line 488 - classes/db/Db.php] - [1 Arguments]
    Argument [0]
    SELECT s.id_shop, CONCAT(su.physical_uri, su.virtual_uri) AS uri, su.domain, su.main
                        FROM ps2_shop_url su
                        LEFT JOIN ps2_shop s ON (s.id_shop = su.id_shop)
                        WHERE (su.domain = '127.0.0.1' OR su.domain_ssl = '127.0.0.1')
                            AND s.active = 1
                            AND s.deleted = 0
                        ORDER BY LENGTH(CONCAT(su.physical_uri, su.virtual_uri)) DESC
  • DbCore->executeS - [line 320 - classes/shop/Shop.php] - [1 Arguments]
    Argument [0]
    SELECT s.id_shop, CONCAT(su.physical_uri, su.virtual_uri) AS uri, su.domain, su.main
                        FROM ps2_shop_url su
                        LEFT JOIN ps2_shop s ON (s.id_shop = su.id_shop)
                        WHERE (su.domain = '127.0.0.1' OR su.domain_ssl = '127.0.0.1')
                            AND s.active = 1
                            AND s.deleted = 0
                        ORDER BY LENGTH(CONCAT(su.physical_uri, su.virtual_uri)) DESC
  • ShopCore::initialize - [line 95 - config/config.inc.php] - [0 Argument]
  • require - [line 27 - index.php] - [1 Arguments]
    Argument [0]
    /srv/www/htdocs/DOMAIN_NAME/config/config.inc.php

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in/srv/www/htdocs/DOMAIN_NAME/classes/exception/PrestaShopException.php on line 147

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in/srv/www/htdocs/DOMAIN_NAME/classes/log/FileLogger.php on line 39

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

I will just add to the above that my shop files are located in /srv/www/htdocs/MY_LIVE_DOMAIN_NAME/ folder

 

As I noticed in this:

 

[PrestaShopDatabaseException]

Table 'MY_LIVE_DOMAIN_NAME.ps2_shop_url' doesn't exist

 

but in phpMyAdmin ps_2_shop_url table exist so prestashop must think somehow that prefix is "MY_LIVE_DOMAIN_NAME.ps2_"

 

but in config/settings.inc.php

 

define('_DB_PREFIX_', 'ps2_');
 
unless I messed something in:
 
ps2_shop_url
ps2_configuration
 
all setting regarding shop localization were set to localhost/MY_LIVE_DOMAIN_NAME
than changed to localhost but still same errors in FO
 
Thanks
Edited by emvoo (see edit history)
Link to comment
Share on other sites

I`ve done it, somehow on completly new installation.

 

Steps i`ve taken to get it done:

 

1.

unzip ~/Desktop/prestashop_1.5.6.1.zip

2.

su - root

and type root password

 

3. make directory for your prestashop (can be any name)

mkdir /srv/www/htdocs/shop

4. move prestashop installation files into the folder you`ve just created

mv /home/user/Desktop/prestashop /srv/www/htdocs/shop

5. (some of the following folders might be missing depends on PS version)

cd /srv/www/htdocs/shop
chmod 0755 config
chmod 0755 upload
chmod 0755 download
chmod 0755 tools/smarty/compile
chmod -R 0755 img
chmod -R 0755 mails
chmod -R 0755 modules
chmod -R 0755 themes/prestashop/lang
chmod -R 0755 translations

6.change the owner of your shop folder (note that wwwrun is default apache user in openSUSE)

chown -R wwwrun /srv/www/htdocs/shop

to find out your apache user:

cat /etc/passwd

7. create database

mysql -u root -p
create database shop;
exit

8.in a web browser type

localhost/shop/install

and start installation of prestashop

 

9. when finished try to login to BO to check installation was succesful

10. 

localhost/phpMyAdmin

and drop all tables in database named shop

 

11. back in terminal import a database of your live shop (note it might take a while - 21mb took about 2hrs on my laptop)

mysql -u root -p
use shop
source path_to_your_backed_up_database_of_your_live_shop
exit

12.

localhost/phpMyAdmin
PS_SHOP_DOMAIN -> 127.0.0.1
PS_SHOP_DOMAIN_SSL -> 127.0.0.1

locate database shop. Find table ps_configuration and on about 8 page of that table locate PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL edit both values from your webaddress to 127.0.0.1

 

13. locate ps_shop_url and edit 

domain -> 127.0.0.1
domain_ssl -> 127.0.0.1
physical_uri -> /shop/

14. now you need to get the access back to your back office. 

SciTE /srv/www/htdocs/shop/config/settings.inc.php

and locate 

define('_COOKIE_KEY_', 'COPY_THAT_STRING');

in phpMyAdmin locate ps_employee, edit your profile (can be many - you know best ;)

in passwd choose function MD5 delete existing value and paste COPY_THAT_STRING from above instruction and right after type your new password so it looks like that:

COPY_THAT_STRINGpassword

and click Go. Now you should be able to access BO. Now we need to take care of FO. To be able to access FO you actually need to copy following folders from your server to /srv/www/htdocs/shop :

classes
controllers
css
download
img
js
localization
log
mails
modules
newsletters
pdf
stats
themes
tmp
tools
translations
upload
webservice

Your FO should be accessible. If its not:

SciTE /srv/www/htdocs/shop/config/defines.inc.php

locate

define('_PS_MODE_DEV_', false);

and change to

define('_PS_MODE_DEV_', true);

save and exit. Now go to FO and look for errors if any.

 

Only problem Ive got is Friendly URL must be off in order to see products images.

 

That should be it. I dont know why it didn`t work before. Im glad its working now as I`ve spent like 4 days trying to solve it. 

 

Thanks everyone anyway

  • Like 1
Link to comment
Share on other sites

  • 7 months later...
  • 5 months later...

I put errors on and get the following

 

Notice: Use of undefined constant _RIJNDAEL_KEY_ - assumed '_RIJNDAEL_KEY_' in /Users/David/Sites/shop/prestashop/classes/Cookie.php on line 80

Notice: Use of undefined constant _RIJNDAEL_IV_ - assumed '_RIJNDAEL_IV_' in /Users/David/Sites/shop/prestashop/classes/Cookie.php on line 80

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/David/Sites/shop/prestashop/classes/Cookie.php on line 300

 
Link to comment
Share on other sites

  • 1 year later...

Hi guys, 
 
thank you emvoo for this great tutorial. I am trying to create dev version of my live store (PS 1.6.1.0), I would like to develop my theme on the same localhost DEV version of my live store, but when I replace folder htdocs/modules, FO works great but I can´t access my BO (only blank page without errors) -  apache error log: 

 
[mpm_winnt:notice] [pid 3316:tid 224] AH00418: Parent: Created child process 5064
[ssl:warn] [pid 5064:tid 236] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[ssl:warn] [pid 5064:tid 236] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[mpm_winnt:notice] [pid 5064:tid 236] AH00354: Child: Starting 150 worker threads.

Prestashop 1.6.1.0, XAMPP v 3.2.2, Apache 2.4.17, PHP 5.6.23

 

I disabled SSL in db (ps_configuration > PS_SSL_ENABLED  value 0). Is here anybody who solved this problem? Thank you very much for any Idea.

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

×
×
  • Create New...