Menù

How to Clone Your PrestaShop Site – 2024 Edition

Imagine this: you've poured your heart and soul into crafting the perfect PrestaShop store. It's sleek, feature-rich, and attracting tons of customers. But now, update time looms... with a chilling twist. What if the update introduces bugs that crash your site, leaving your precious store in shambles for everyone?

Don't panic, fellow PrestaShop enthusiast! A simple yet powerful solution is at your fingertips: cloning your site.

 

Why Clone Your PrestaShop Site?

Think of a clone as your store's secret twin, a haven for experimentation and testing. Here's why cloning is your best friend:

  • Fearless experimentation: Unleash your inner mad scientist! Test new features, plugins, and updates in the clone without jeopardizing your live site.
  • Smooth troubleshooting: Encountered an issue? Debug and fix it in the comfort of your clone, ensuring a seamless experience for your customers.
  • Stress-free development: Build new features, optimize pages, and refine your store's look and feel all in a stress-free testing environment.

 

The Simplest Solution? You Bet!

Cloning your PrestaShop site is not just essential, it's surprisingly easy. In this comprehensive guide, we'll walk you through the entire process step-by-step, from initial setup to seamless testing and deployment.

Ready to unleash the power of cloning and safeguard your live store? Dive into this guide and experience the magic of worry-free PrestaShop updates!

 

Step-by-Step Guide to Duplicate a PrestaShop Site

Step 1: clone your website’s code

Create a "dev" folder within your website's root directory.

1-%20Create%20dev.png

Zip relevant files from the live site, excluding unnecessary folders (test folders, backup folders, etc.) for a faster process.

2-%20Zip%20code.png

3-%20Select%20zip.png

4-%20Rename%20backup%20file.png

5-%20Close%20&%20reload.png

Reload site. Move the compressed file to the "dev" folder and extract its contents.

6-%20Reload.png

7-%20Move%20to%20dev.png

8-%20Enter%20dev%20folder.png

Go to the “dev” folder then extract the compressed file.

9-%20Extract.png

10-%20ok_1.png

 

Step 2: clone your website’s database

Create a new database for the "dev" site, ensuring compatibility and easy identification.

  • Select database type: "utf8_general_ci" for best compatibility (if the server gives options, and it is available).
  • Use the same database name as the dev folder name for easy searching.

11-%20Create%20database.png 11-%20dev%20database_1.png

12-%20Back_1.png

Create a new user.

13-%20Create%20user.png

14-%20Back.png

Add the new user to the database, then assign all privileges to the user:

15-%20Add%20user%20to%20database.png

16-%20Add%20permission.png

Log into your site’s database, find and select the current database of your live website. Go to the “Export” tab and export to .sql file.

17-%20Go%20to%20database.png

18-%20Export%20sql.png

19-%20Save.png

Go to the “dev” database that you created => import the .sql file that you have just exported from the live site.

20-%20Import_1.png

  

Step 3: Configuration

Open the configuration file in the code file of the "dev" site => then enter the database information to connect the "dev" site to its database.

  • For the site using PrestaShop version 1.7.x to 8.x: Find and open /dev/app/config/parameters.php file in the “dev” folder.
  • For the site using PrestaShop 1.6.x: Find and open /dev/config/settings.inc.php file in the “dev” folder, then do the same as site 1.7.x

21-%20Configure%20code.png

Change these parameters to the ones you set up for the new database: database name + database user + database password.

22-%20Add%20database.png

Configure "shop_url” table:

  • Go to the “dev” database of the newly created site => find the "shop_url" table
  • Change the values of the “domain” and “physical_uri” columns in table “shop_url” table of the “dev” database to the domain and URI of your “dev” site.

23-Configure%20database%20-%20shop_url_1.png

Configure “ps_configuration” table:

  • Open the “ps_configuration” table of the “dev” database.
  • On the Filter section: enter the “250” value for “Number of rows”; enter the “domain” value for “Filter rows” to search.
  • In the search results, replace the domain of the "dev" site in the value column of the two lines:
    • PS_SHOP_DOMAIN
    • PS_SHOP_DOMAIN_SSL

 24.png

Access the Back Office of the new copy site via the domain: your_domain/your_dev_folder/admin_folder

E.g.: example.com/dev/admin1

      

Step 4: generate friendly URLs and clear cache

Tips for convenience:

  • Edit the "htaccess" file if back-office access issues arise.

25-%20Change%20htaccess.png

26-%20Change%20RewireRule.png

  • Enable/disable Friendly URLs in "Shop Parameters > Traffic & SEO".

27-%20Change%20friendly%20URL.png

  • Clear cache in "Advanced Parameters > Performance".

28-%20Clear%20cache.png

  

Conclusion

Creating a PrestaShop copy site might sound complex, but it's a crucial and manageable process. Follow the outlined steps to clone your store successfully, and refer to the provided tips for added convenience. Your replicated PrestaShop site is now ready for comprehensive testing and updates.

Conteggio visualizzazioni articolo: 245 visualizzazioni