Jump to content

making my local prestashop online, import database, HTTP 500


Recommended Posts

Hello everyone!

 

I´m trying to put online my first prestashop store, but I'm having problems when I try to import the local database to the server. After proceding with the import, when I try to access the shop, I find an HTTP 500 error.

 

My hosting doensn't allow me to choose de database name, so the export database and the import database aren't called the same, anyway I tried changing the database name in the .sql, but didn't work.

 

What I'm doing is deleting all tables created during instalation and importing the .sql from local.

 

Could you please explain me the steps I have to follow?

 

Thanks!

Link to comment
Share on other sites

when you say importing from local, do you mean that you have your prestashop running on your localhoost? wamp?

 

if so then you would just export your local mysql data, load it into your production system (assuming phpmyadmin on both systems), ftp your local file to your server, then edit you remote settings.inc.php with the new db settings, passwords.

Link to comment
Share on other sites

Hi elpatron, thanks for your reply!

 

Yes, I installed Prestashop on my localhost with XAMPP and configured my shop, added products, images, etc.

 

I have just done that, but it didn't work.

What I have done is:

 

1) Copy the uncompressed prestashop files (the original ones, just downloaded) to /html on server via FTP

 

2) Create an empty database on server through phpmyadmin

 

3) Install Prestashop on server from zero (database is detected, mails are sent...)

 

Now I proceed to migrate my local Prestashop to server:

 

4) Replace the server original prestashop folders img, modules and themes with my local ones as I have new pictures, installed new modules, etc...

 

5) Export my local mysql data with phpmyadmin:

- select prestashop database (called 'prestashop')

- select all tables (the number of tables in localhost is 177, while in server (original installation) is 166)

- add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT

- add IF NOT EXISTS

- add AUTO_INCREMENT

- add "backquotes" with tables...

 

6) Load mysql data in production

- select prestashop database (called 'qms158')

- Import without errors

 

 

Now, if I try to access mydomain.com or mydomain.com/admin, I find this error:

Error HTTP 500 (Internal Server Error): An unexpected condition has been found when server tried to attend the petition.

 

(more or less, I have translated it)

 

Then, I have red that I have to change user password with this sentence:

update ps-employee set passwd=md5(“<COOKIE_KEY><NEWPASS>”) where email=”<EMAIL>”

 

So I have done it, but I have the same error.

 

Finally I edited the remote remote settings.inc.php

Password and user where right, the only thing I replaced is:

define('_DB_SERVER_', 'localhost');

with

define('_DB_SERVER_', 'slggxxx.xxx.com');

 

where slggxxx.xxx.com is the Hostname/ phpMyAdmin Access provided b hosting when I created the database.

 

 

What am I doing wrong?

Could you please explain me the steps to follow? I'm quite desperate :S

 

Thanks a lot!

  • Like 1
Link to comment
Share on other sites

If you have the site running on your localhost, there is no reason to re-install it on your remote serverf.

 

1. ftp your local site to the remote server

2. export your local mysql database for your shop

3. import your local mysql data base into your remote mysql database

4. modify the settings.inc.php with the new db settings, password...etc...(make sure to back up your localhost settings)

 

you should be up and running!...

 

(note: I am new to ps, I have not actually loaded my localhost copy to remote yet) these instructions are based on plenty of other site uploads from localhost to remote servers....

Link to comment
Share on other sites

note: if you created an ,httaccess file via the ps back end...this may or may cause problems depending on your remote server.

 

If you created an httaccess on your local via the backend you may want to consider removing it from you local install. you can do this by renaming it the file or turning off friendly ur's in the 'generation' area. If you turn off freindly url's via the be not get rid of the file, but it will be without mod_rewrite.

 

Good luck!...and since I piped in on this thread, it seems only right that I check it, so I will upload a copy of ps from my local host to my server, and test it. will then report back

Link to comment
Share on other sites

I have an httaccess, so I think I will turn off friendly url's to avoid that problem and then, if everythnig is OK in the remote server, configure friendly url's again (both in remote server and localhost again).

 

It would be great if you could test it. I'll do it as soon as I can and get back with the results.

 

Another thing I'm thinking about is that my local machine is a windows, while the remote server is a linux. Maybe this could cause some trouble when I copy my local installation to the remote server?

Link to comment
Share on other sites

good point on difference of local env vs remote environments. Without running a true ps install one bypasse's the checks for module and permissions. (: I have ps's already on my remote server, so I expect this all to work). The problem I currently have is my internet connection here in Colombia is rather slow. It will take several hours to ftp up my site...

Link to comment
Share on other sites

How I moved an installed prestaship from localhost to a remote server. PrestaShop 1.4.5.1 running on local and remote host, apche 2, php 5.3.8. These instructions are for a subdomain. Just remove the subdomain from the instructions and it will work fine for domains.

 

see this: http://www.addons-mo...ps_shop_domain/

 

Changed the following fields in the new remote mysql db table yourprefix_configuration:

PS_SHOP_DOMAIN alpha.mywebsite.com.co

PS_SHOP_DOMAIN_SSL alpha.mywebsite.com.co

  • Uploaded site files to subdomain/domain root
  • Exported shop localhost database, created remote server database and imported the localhost sql
  • Updated the settings.inc.php as follows

· From: (running localhost)

 

· define('_DB_SERVER_', 'localhost');

· define('_DB_TYPE_', 'MySQL');

· define('_DB_NAME_', 'prestashop141alpha');

· define('_DB_USER_', 'root');

· define('_DB_PASSWD_', ‘mypassword’);

· define('_DB_PREFIX_', 'alpha_');

· define('_MYSQL_ENGINE_', 'InnoDB');

· define('__PS_BASE_URI__', '/prestashop141alpha/');

To: (running remote) subdomain alpha.mydomain.com.co

· define('_DB_SERVER_', 'localhost');

· define('_DB_TYPE_', 'MySQL');

· define('_DB_NAME_', 'alpha');

· define('_DB_USER_', 'alpha');

· define('_DB_PASSWD_', ‘mypassword’);

· define('_DB_PREFIX_', 'alpha_');

· define('_MYSQL_ENGINE_', 'InnoDB');

· define('__PS_BASE_URI__', '/');

 

Resulted in:

Back Office – will not accept my password. Reset the pwd : See http://nickbartlett....-in-prestashop/

 

This site is working both on the back and front sides.

 

NOTE(s)

MAKE SURE TO CLEAR YOUR BROWSER COOKIES WHEN TESTING!

I already have prestashop sites on my remote server so I know that the necessary modules are loaded.

Link to comment
Share on other sites

Hi,

 

bad news. After following these steps and spending some hours trying to find the error, I have the same problems and I really don't know what to do...

 

I have followed these steps in this order:

  1. Turn off friendly URL's in my local installation
  2. Remove all prestashop files and database from remote server.
  3. Create a database in remote server called "qmt127"
  4. Upload my local prestashop installation to the root directory of my hosting: /html
  5. Export my local prestashop database, called "prestashop", to an .sql file, using phpmyadmin:
    • Select prestashop database
    • Select SQL
    • Under structure, select:
       
      Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT
      Add IF NOT EXISTS
      Add value AUTO_INCREMENT
      Use "backquotes" ...

    • Under data, select:
      Complete INSERTs
      Extended INSERTs
      Use hexadecimal for BLOBS
       
      ​No compression


  •  
    Import the local database .sql file to the remote server using phpmyadmin. I had to edit the .sql file, changing database name from "prestashop" to "qmt127": USE 'qmt127';
  • Edit settings.inc.php:
     
     

    1.  
      Original:
       
      <?php
       
      define('__PS_BASE_URI__', '/prestashop/');
      define('_MEDIA_SERVER_1_', '');
      define('_MEDIA_SERVER_2_', '');
      define('_MEDIA_SERVER_3_', '');
      define('_PS_CACHING_SYSTEM_', 'MCached');
      define('_PS_CACHE_ENABLED_', '0');
      define('_THEME_NAME_', 'prestashop');
      define('_DB_NAME_', 'prestashop');
      define('_MYSQL_ENGINE_', 'InnoDB');
      define('_DB_SERVER_', 'localhost');
      define('_DB_USER_', 'root');
      define('_DB_PREFIX_', 'ps_');
      define('_DB_PASSWD_', '');
      define('_DB_TYPE_', 'MySQL');
      define('_COOKIE_KEY_', 'xxxnBoHbfgigs8grN8u8H8zm3r4fUVfaef7taz');
      define('_COOKIE_IV_', 'xxx6i7d');
      define('_RIJNDAEL_KEY_', 'xxx1XZtwi5ae8ssEQqPU');
      define('_RIJNDAEL_IV_', 'xxxrUIx2IjhnEd/A==');
      define('_PS_VERSION_', '1.4.4.1');
       
      ?>

    2.  
       
      Updated:
       
      <?php
       
      define('__PS_BASE_URI__', '/');
      define('_MEDIA_SERVER_1_', '');
      define('_MEDIA_SERVER_2_', '');
      define('_MEDIA_SERVER_3_', '');
      define('_PS_CACHING_SYSTEM_', 'MCached');
      define('_PS_CACHE_ENABLED_', '0');
      define('_THEME_NAME_', 'prestashop');
      define('_DB_NAME_', 'qmt127');
      define('_MYSQL_ENGINE_', 'InnoDB');
      define('_DB_SERVER_', 'localhost');
      define('_DB_USER_', 'qmt127');
      define('_DB_PREFIX_', 'ps_');
      define('_DB_PASSWD_', 'mypass');
      define('_DB_TYPE_', 'MySQL');
      define('_COOKIE_KEY_', 'xxxnBoHbfgigs8grN8u8H8zm3r4fUVfaef7zaz');
      define('_COOKIE_IV_', 'xxx6i7d');
      define('_RIJNDAEL_KEY_', 'xxx1XZtwi5ae8ssEQqPU');
      define('_RIJNDAEL_IV_', 'xxxrUIx2IjhnEd/A==');
      define('_PS_VERSION_', '1.4.4.1');
       
      ?>

    [*]Edit "PS_SHOP_DOMAIN" and "PS_SHOP_DOMAIN_SSL" in 'ps_configuration' table with domainname.com value

When I try to access the shop with firefox, I don't get anything. With chrome, I get an HTTP 500 error

 

After this I executed the SQL sentence to change the password and tried again but with the same result.

 

 

My hosting meets prestashop requirements as I am able to perform a fresh installation and make it work. I'm doing some of these steps in a wrong way but I don't see the error...

 

Please help :S

Link to comment
Share on other sites

Hi!

 

I've just repeated the process oll over again, resulting in the same error.

I think I have a problem with the .htaccess (I'm afraid I don't understand exactly what I have to do with this file)

 

Another thing I have just realized is that, when I updated the settings.inc.php, I put define('__PS_BASE_URI__', '/');

But, reviewing the remote server database (after the process has been finished) I found this:

240 __PS_BASE_URI__ /prestashop/

Which was the value of _PS_BASE_URI_ in the settings.inc.php of my local machine prestashop :huh:

 

I tried changing it to / (the value of _PS_BASE_URI_ in the settings.inc.php of the remote server), but that did not work...

 

I'm sure the problem has something to do with the .htaccess or the settings.inc.php files...

 

Any ideas?

 

Many thanks for your help in advance

Link to comment
Share on other sites

Hi!

 

Still the same problem.

I don't know what to do. Can anyone help me please? Perhaps there is some problem with the htcaccess file?

 

This is the htaccess content:

 

 

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution

# WARNING: PLEASE DO NOT MODIFY THIS FILE MANUALLY. IF NECESSARY, ADD YOUR SPECIFIC CONFIGURATION WITH THE HTACCESS GENERATOR IN BACK OFFICE

# http://www.prestashop.com - http://www.prestashop.com/forums

 

 

<IfModule mod_rewrite.c>

# URL rewriting module activation

RewriteEngine on

 

# URL rewriting rules

RewriteRule ^api/?(.*)$ /prestashop/webservice/dispatcher.php?url=$1 [QSA,L]

</IfModule>

 

# Catch 404 errors

ErrorDocument 404 /prestashop/404.php

 

<IfModule mod_expires.c>

ExpiresActive On

ExpiresByType image/gif "access plus 1 month"

ExpiresByType image/jpeg "access plus 1 month"

ExpiresByType image/png "access plus 1 month"

ExpiresByType text/css "access plus 1 week"

ExpiresByType text/javascript "access plus 1 week"

ExpiresByType application/javascript "access plus 1 week"

ExpiresByType application/x-javascript "access plus 1 week"

ExpiresByType image/x-icon "access plus 1 year"

</IfModule>

 

FileETag INode MTime Size

<IfModule mod_deflate.c>

AddOutputFilterByType DEFLATE text/html

AddOutputFilterByType DEFLATE text/css

AddOutputFilterByType DEFLATE text/javascript

AddOutputFilterByType DEFLATE application/javascript

AddOutputFilterByType DEFLATE application/x-javascript

</IfModule>

 

 

I've spent 4 days with this and I'm absolutely lost...

 

Thanks!

Link to comment
Share on other sites

Hi!

 

I've just repeated the process oll over again, resulting in the same error.

I think I have a problem with the .htaccess (I'm afraid I don't understand exactly what I have to do with this file)

 

Another thing I have just realized is that, when I updated the settings.inc.php, I put define('__PS_BASE_URI__', '/');

But, reviewing the remote server database (after the process has been finished) I found this:

240 __PS_BASE_URI__ /prestashop/

Which was the value of _PS_BASE_URI_ in the settings.inc.php of my local machine prestashop :huh:

 

I tried changing it to / (the value of _PS_BASE_URI_ in the settings.inc.php of the remote server), but that did not work...

 

I'm sure the problem has something to do with the .htaccess or the settings.inc.php files...

 

Any ideas?

 

Many thanks for your help in advance

 

Good morning lunchbox,

 

Until you resolve this issue, then it will not work. As for the .htaccess file, just rename it on the remote server to something else, like .htaccessbackup or simply delete it. An important note, make sure to clear your cookies each time you make a change and are ready to test it. Else you will get unpredictable results.

 

The guide I posted worked for me, but only after clearning cookies. Note: some servers cache .htaccess and it can take a little bit of time to cycle in the new one. You may want to consult with your server folks.

Link to comment
Share on other sites

  • 2 weeks later...

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...