Jump to content

Test and Production environment workflow


Recommended Posts

hello,

I am fairly new here, so forgive my post if this has been already discussed and my search were unsuccessful in finding the related threads.

I am administrating an existing PrestaShop environment for a new client who didn't have any backup, so I proceeded immediately to backup the web folder structure and the database without any problem.

But my question is about restoring and also creating a test environment to try new setups and changes before bringing them in his production environment.

The migration and restore procedures I found so far for 1.7.x do not completely address certains aspects, such as https certificates, changing config for potentially different versions of apache environments and other things. The procedure I followed is: https://websitemigrationguides.com/guide.php?migrate=4, (very well explained indeed). Unfortunately, once done, for some reason I can't pass the home page when I restore it into my localhost environment.

Does anyone know of any other documented complete procedure to migrate a working environment into another one and to verify that all is good in case it needs to be restored? 
Other things that I understood needed to be done are beside the aforementioned procedure are:

* update the ps_configuration table with the new PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL with the new domain
* update ps_shop_url with the new url.
* update config/parameter.php with the new db location and credential. 
all done ok, and the home page loads, but clicking on any item result into a xampp dashboard page. Also the browser complain about wrong certificates.

Any clue that could point me to a step forward in the resolution of this issue is very appreciated. Again: the goal is to replicate the working environment into a local one.

Regards,

/Flavio

 

Link to comment
Share on other sites

thanks all for the missing steps. I have included in my sequence.

I also added the disabling of SSL, since the certificate won't work, by setting to 0 the related ps_configuration records. So, for anyone interested, the consolidated sequence of activities is captured below.

Cheers,

/Flavio

Migration or replication of production environment: list of activities (tested for prestashop 1.7.5) 

  • Database 
    • Create a mysql database and import the zip or sql database exported from the production environment
    •  ps_configuration:
      • PS_SHOP_DOMAIN: new domain (in my case: localhost)
      • PS_SHOP_DOMAIN_SSL: new domain (in my case: localhost)
      • PS_SSL_ENABLED_EVERYWHERE: 0 for disabled, 1 for enabled. In my case I had to turn it off, being on localhost
    • ps_shop:
      • the name of the shop, which must match the root of the web folder structure
    • ps_shop_url
      • replace the two domain fields with the new domain, and the name of the show with the new one. In my case: 1,1,localhost,localhost, /NewName/,,1,1
  • configuration:
    •  from xampp config button on apache and then php.ini, or directly in the php.ini file, or the equivalent config file, the following parameters:
      • memory_limit = 128M
      • max_execution_time=300;
      • max_input_time=-1
      • upload_max_filesize=25M;
      • post_max_size=20M;
      • max_input_vars=10000
  • Web files
    • Unzip the entire web structure of the production environment to the new place
    • app/config/parameter.php: 
      • DB name: new db name as in step 1 of Database section.
      • location: new domain where MySQL server is running. In my case: localhost
      • Admin and password of the MySQL administrator. 
      •  delete /var/cache
      •  regenerate .htaccess
      • check the entire web folder structure has read write permissions
      •  if needed, set _PS_MODE_DEV to true in config/define.inc.php to troubleshoot connection or http errors.

I hope this summary could be useful to some. Please don't hesitate to add or correct if something needs improvement.

Cheers,

/Flavio

 

  • Like 3
  • Thanks 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...