Reinstalling PrestaShop is a process that involves removing the existing installation and setting it up again. This guide walks you through the steps to ensure a clean and successful reinstallation.
Backup Existing Data (Optional but Recommended)
Before reinstalling PrestaShop, it is a good idea to back up your current store, just in case you need the data later.
Backup the Files
- Log in to your server via SSH or FTP.
- Navigate to the directory where PrestaShop is installed (e.g., /var/www/html/prestashop).
- Download the directory to your local computer.
Backup the Database
- Log in to phpMyAdmin or connect via MySQL CLI:
- Save the database backup to a secure location.
mysqldump -u root -p prestashop_db > prestashop_backup.sql
Remove the Existing Installation
1
Delete Files
- Navigate to the PrestaShop directory:
- Delete the entire directory:
cd /var/www/html/prestashop
sudo rm -rf /var/www/html/prestashop
2
Drop the Existing Database
- Log in to MySQL:
- Drop the PrestaShop database:
- (Optional) Recreate the database for a fresh install:
sudo mysql -u root -p
DROP DATABASE prestashop;
CREATE DATABASE prestashop;
CREATE USER 'prestashop_user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON prestashop.* TO 'prestashop_user'@'localhost';
FLUSH PRIVILEGES;
CREATE USER 'prestashop_user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON prestashop.* TO 'prestashop_user'@'localhost';
FLUSH PRIVILEGES;
Download and Reinstall PrestaShop
Download PrestaShop
- Navigate to your web server root directory:
cd /var/www/html
- Download the latest version of PrestaShop:
wget https://download.prestashop.com/releases/prestashop_1.7.8.8.zip
Extract Files
- Install unzip if not already installed:
sudo apt install unzip -y
- Extract the archive:
unzip prestashop_1.7.8.8.zip
mv prestashop /var/www/html/prestashop
Set Permissions
- Set ownership:
sudo chown -R www-data:www-data /var/www/html/prestashop
- Set proper permissions:
sudo chmod -R 755 /var/www/html/prestashop
Create a New Configuration
- Open your browser and navigate to:
http://yourdomain.com
- Follow the installation wizard:
- Database Details: Enter the database name, username, and password you created earlier.
- Admin Account: Set up a new administrator account.
Post-Installation Steps
Delete the Install Directory
After completing the installation, delete the install directory for security:
sudo rm -rf /var/www/html/prestashop/install
Secure Your Admin Directory
- Rename the admin directory:
- Update the new directory name in your browser:
mv /var/www/html/prestashop/admin /var/www/html/prestashop/admin_secure
http://yourdomain.com/admin_secure
Optional: Restore Data
If you need to restore data from your previous installation:
- Import the backed-up database:
mysql -u root -p prestashop < prestashop_backup.sql
- Copy old images, themes, or other files back to /var/www/html/prestashop.
Troubleshooting
| Issue | Solution |
|---|---|
| Installation wizard not loading | Check file permissions and web server configuration. |
| Database connection error | Verify database credentials and user privileges. |
| Blank page after reinstallation | Enable PHP error reporting and check logs. |
Reinstalling PrestaShop ensures a clean setup, resolving any previous configuration issues.


