patch - Environment PatchingApply local environment configurations to cloned files and database dumps for optimal local development.
The patch command modifies cloned shop files and database configurations to work correctly in your local development environment, ensuring seamless integration between remote code and local infrastructure.
clone commandBefore running the patch command:
ps-enterprise authps-enterprise configps-enterprise remote-dump to get the database stateps-enterprise cloneps-enterprise patch
| Flag | Short | Description | Required |
|---|---|---|---|
--help |
-h |
Show command help | No |
The patch command performs several modifications to prepare your environment for local development:
# Complete local environment setup
ps-enterprise remote-dump # Get database dump
ps-enterprise clone # Get shop files
ps-enterprise patch # Apply local configurations
# Files and database are now ready for local development
ps-enterprise stop # Stop local environment
ps-enterprise remote-dump # Update database
ps-enterprise patch # Re-apply patches with new settings
ps-enterprise start # Start local environment
The patch command modifies several types of files:
app/config/parameters.yml - Database and system configurationconfig/defines.inc.php - PrestaShop core definitions.htaccess - Apache URL rewriting and security rulespatch command are specific to your local environment. Do not commit these modified files to your version control system (e.g., Git). They should be ignored to avoid conflicts and issues in production or other environments.Executed before database import:
-- Disable foreign key checks for import
SET FOREIGN_KEY_CHECKS=0;
SET UNIQUE_CHECKS=0;
SET AUTOCOMMIT=0;
Executed after database import:
-- Update shop URLs
UPDATE ps_configuration SET value='http://localhost:8080/' WHERE name='PS_SHOP_DOMAIN';
UPDATE ps_configuration SET value='http://localhost:8080/' WHERE name='PS_SHOP_DOMAIN_SSL';
-- Enable development mode
UPDATE ps_configuration SET value='1' WHERE name='PS_MODE_DEV';
-- Re-enable checks
SET FOREIGN_KEY_CHECKS=1;
SET UNIQUE_CHECKS=1;
COMMIT;
After successful patching:
✓ Database configuration updated
✓ URL rewriting configured
✓ .htaccess modified for local environment
✓ Database queries prepared
✓ File permissions set
✓ Local environment ready
❌ Shop files not found. Please run 'ps-enterprise clone' first.
Solution: Run the clone command to download shop files before patching.
❌ Database dump not found at ./tmp/dump.sql
Solution: Run ps-enterprise remote-dump to create database dump before patching.
❌ Permission denied: Cannot modify configuration files
Solution: Check and fix file permissions.
❌ Invalid local configuration. Please run 'ps-enterprise config'.
Solution: Re-run the configuration command to ensure valid local settings.
clone - Must be run before patching (provides files to patch)remote-dump - Usually run before patching (provides database to patch)config - Provides configuration used by patch processstart - Uses patched files to start local environment