Jump to content

Migrate shop from localhost to server


ales496

Recommended Posts

Hi everybody
i'm trying to migrate my shop from localhost to my server, but I got several errors, even if I tried to clear cache, so I suppose that I'm wronging something.
In localhost I have my main dir called 'proj' and inside that I have my prestashop dir called 'catalogo'.
Assuming that I need to upload proj dir, to my server exposed via url 'https://www.proj.com', what steps should i follow?

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

1) In app/config/parameters.php I updated 'database_host' to my VPS ip and even database credentials;
2) In table 'ps_shop url' I updated 'domain' and 'domain_ssl' fields with https://project.com
3) In the same table I updated 'physical_uri' field with '/catalogo/'
4) Deleted everything in var/cache/

Between many warning I got the following error:
Fatal error: require_once(): Failed opening required '/var/www/html/project/catalogo/var/cache/dev/appParameters.php'

Link to comment
Share on other sites

After editing permissions in every folder, now I get no errors, but if I try to connect to www.proj.com/catalogo Im redirected to https://https//www.proj.com//catalogo/ and of course the url doesnt work.

If I try to reach the admin folder instead, I got the error:
This page isn’t working
www.proj.com is currently unable to handle this request. 

In catalogo folder, the .htaccess file is not generated

Link to comment
Share on other sites

34 minutes ago, musicmaster said:

I am curious what you put as domain in ps_shop url. It should be the basic domain. So just "www.shop.com". No http and no slashes.

Thanks.
Instead, in domain ssl, should I use the same notation (www.shop.com) or have I to specify https before?

Link to comment
Share on other sites

You're right, but I can't try, because with both solutions I got:
Fatal error: Trait 'Psr\Log\LoggerAwareTrait' not found (/var/www/html/proj/catalogo/vendor/composer/../psr/log/Psr/Log/LoggerAwareTrait.php)

I was editing previous question, but you answered too soon
 

Link to comment
Share on other sites

a) for every try: empty the cache. You can use Prestools for that or empty the /var/cache directory.

b) you are still murky. Please be crystal clear what you put into the ps_shop_url table. Consider adding a screen dump.

c) Provide a screen dump of the error. It will provide previous code steps that led to the error. You can blacken out private information.

d) Your error refers to a file. Look whether that file is present.

  • Like 1
Link to comment
Share on other sites

3 minutes ago, musicmaster said:

See point d) of my previous reaction. Please react only when you exhaust my previous suggestions.

I already answered

"I can't find LoggerAwareTrait.php, but it doesn't exist neither in localhost."

Link to comment
Share on other sites

2 minutes ago, ales496 said:

I already answered

"I can't find LoggerAwareTrait.php, but it doesn't exist neither in localhost."

I don't care about localhost. I care about the file system.

In my PS 8.1 installation I see a file /vendor/psr/log/Psr/Log/LoggerAwareTrait.php. If you don't have that file your installation is broken.

  • Like 1
Link to comment
Share on other sites

I tried to edit physical_uri field in ps_shop_url table and after many attempts I noticed that writing just '/' it works, but it doesn't load css.

In browser console I got many times the following error:
Mixed Content: The page at '<URL>' was loaded over HTTPS, but requested an insecure stylesheet '<URL>'. This request has been blocked; the content must be served over HTTPS.

Link to comment
Share on other sites

18 minutes ago, ales496 said:

I tried to edit physical_uri field in ps_shop_url table and after many attempts I noticed that writing just '/' it works, but it doesn't load css.

In browser console I got many times the following error:
Mixed Content: The page at '<URL>' was loaded over HTTPS, but requested an insecure stylesheet '<URL>'. This request has been blocked; the content must be served over HTTPS.

Looks like you set in the backoffice to use http and then you called the shop in the browser with https.

  • Like 1
Link to comment
Share on other sites

Now it works.
Many thanks for your help and your patient.

I enclose all the steps that I followed, hoping that in a future they can help someone:
1) In app/config/parameters.php I updated 'database_name', 'database_user' and 'database_password';
2) In table 'ps_shop url' I updated 'domain' and 'domain_ssl' fields with www.project.com
3) In the same table I updated 'physical_uri' field with '/catalogo/'
4) Deleted everything in var/cache/
5) Shop parameters -> General -> Enable SSL / Enable SSL in all pages

Edited by ales496 (see edit history)
  • Like 1
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...