0

I'm writing a script that would back-up my PrestaShop instance installed on my own server. I'm using Prestashop 1.7.7.4.

I suppose it is recommended to put your shop(s) in "Maintenance mode" during database dumping, to make sure nobody interacts with it. However, the only method of enabling the "Maintenance mode" I can find is using the administration panel, which of course requires manual intervention. It makes automatic backups impossible.

Is there any established way to enable "Maintenance mode" using a script/cli/api and not the administration panel?

aqualatus
  • 31
  • 5

2 Answers2

3

For active shop

Configuration::updateValue('PS_SHOP_ENABLE', '1');

For maintenance mode

Configuration::updateValue('PS_SHOP_ENABLE', '0');
Fran Cerezo
  • 940
  • 3
  • 8
  • 19
1

Additional you can upload the script found here: https://github.com/crezzur/myshoprepair/

This script will allow you to perform some important task like removing cache, changing important database variables all needed to restore access to you web-shop but also disable and re-enable you web-shop and add a maintenance ip address.

All features of this file can be viewed in this demo: https://crezzur.com/demoshop17/myshoprepair.php

Crezzur
  • 1,303
  • 2
  • 18
  • 37