Ecommerce Blog - The #1 Source for Ecommerce News, Tips and Trends!

Get ecommerce updates, news, and insider tips from the experts at PrestaShop!

Ecommerce Blog - The #1 Source for Ecommerce News, Tips and Trends!
 

< Back to the Blog home

Test Server Setup For Online Stores

Do you have a test server? If not, you’re taking an unnecessary risk. Modifications on your online store will modify your databases and their connecting files.These modifications need to be fully tested before you implement the changes to your live server and Ecommerce website.

It’s crucial that you know how to manually copy your database and files from your live store to create a duplicate test server.



After you create the test environment feel free to try any upgrade, theme or module to see how it would look on your real store, without wasting any downtime on your live online store.

Don’t be left in the dust by not taking the proper online store management procedures, these extra precautions will save you both time and money.

We will be working with Ecommerce platform PrestaShop, FTP client like FileZilla, phpMyAdmin, and MySQL. If you don’t know what those are, you can Google it for more info or watch the basic Installing PrestaShop video tutorial. 

Test Server Assumptions

For this Tutorial, I’ll have these assumptions, your URL’s will be different but the concept stays the same.

  • I have a LIVE PrestaShop store at www.presta4live.com (Live Store Domain)
  • I have a test domain, and blank directory within FTP.
  • I created a blank database (Click to learn how) for my TEST URL www.presta4test.com (Test Store Domain). [TIP: Remember the Name, Username and Password of your newly created database, you'll need them after]
  • I want to COPY my Database and Files from my Live Domain to the Test Domain, to replicate my store on my test server.

Backing Up Live Store

Let’s get started.
First, we need to Back-Up or Export your Database and Files. This tutorial will give you the basics of what we need to accomplish today. (Click for Tutorial)

Import Database to Test Server

After you backed up and exported your Database and Files of your live store, you are ready to import your Database that your exported from your Live Store. Follow these steps:

  •  Log in to your cPanel of your test domain

  •  Navigate to phpMyAdmin

  • Find and click the Test Database that you made.

  • Now click “Import”

  • Click on “Choose File” and Select the exported database from your Live Domain and import. Leave all settings as default and click Go.

  • When you have finished importing the database from your live store to your test store directory, open up your test url database and click the table ps_shop_url

  • After clicking the table, click on Edit. You want to change the URLs in domain and domain_ssl from your live store’s URL’s to your test stores URL. [TIP: Make sure to put a forward slash at the end of the URL's.] In the screenshot you’ll notice my test URL, yours will be different.

 

Copy PrestaShop Files to FTP

Once that is completed you can log into your FTP of your test store and import the files (not the database) that you copied from your live store via FTP. Simply copy and paste the files into your blank directory you created in your Test Server.

After you import your files, the next step is to change some data in config/settings.inc.php  via FTP . You need to make sure that the DB _NAME is the name of the test database that you created. DB_USER and DB_PASSWD is the username and password of the database

define(‘_DB_NAME_’, ‘presta4test’);

define(‘_DB_USER_’, ‘root’);

define(‘_DB_PASSWD_’, ”);

[TIP: Make sure to manually delete your htaccess in your test server's directory via FTP. Next, regenerate the htaccess by toggling "Yes" "No" in Preferences/SEO & URL's/Friendly URL in your test store's back-office]

Final Touches

That’s it! There are some housecleaning chores you can do in your Back-Office if you want. You can configure the modules with the test API credentials. Because this is a test server, you don’t want Google to crawl it as you may incur duplicate content penalties after a while, so be sure to keep your store in Maintenance Mode.

You now have an replica of your store on a test server. This is useful to test any upgrades to the software, updates to modules and theme changes. Testing first will minimize your downtime and avoid any potential issues that might cause you lose sales. Manage your online store the right way by creating and using a test server.

Feel free to comment below with your thoughts. Thanks for reading and happy selling!

  1. Thanks for the tip.

    I use it in MAMP

  2. What risks would I be facing if I use a subdomain as the test domain?

    For example if my live store is on http://www.presta4live.com (Live Store Domain) and I put the test store on test.presta4live.com (Test Store Domain)
    Would I be subject to Google’s duplicate content penalties?

  3. Author: Carmen

    Date: September 23, 2014 at 2:59 am

    Can I test the server setup just using a subdomain of my Live Store Domain?

    • Author: Benjamin Utterback

      Date: September 23, 2014 at 2:57 pm

      Hi! Yes, you can. That will be the test URL. Just make sure the URL is not made public or linked to anything on your live website. You also need to make sure you change the URL’s in your database and preferences accordingly. Other than that, it’s the same exact process.

  4. Author: bjng

    Date: October 9, 2014 at 10:23 am

    Hi Benjamin,
    thanks for your post.
    I still use ps version 1.4.7.0 and I would like a test area to upgrade to the latest version. I made a copy of the DB. Made a copy of the site in a subdirecotry of the real site. I modified the settings.inc.php.
    Deleted and recreated the htaccess.
    It works but I’ve some problem with the products images.
    In the official site the url used to reach a product image is
    http://www.mydomain.it/5816-9850-large/friendlyurl.jpg
    in test area is
    http://www.mydomain.it/testarea/img/p/9/8/5/0/9850-large.jpg
    I tried to activate/disactivate all the option in SEO & Urls, the urls changes but none options combination let
    show the images.
    What’s wrong? I do not have a table ps_shop_url in the db.

    Thanks in advance and regards
    Stefano

    • Author: Magali Ferber

      Date: October 17, 2014 at 1:54 pm

      Hello Stefano,

      Tipically the fastest way to get an answer for your issue is the PrestaShop Forum. You will find some really talented Community members who will help you solve your issue, if it has not been solved yet by another member for a case just like yours.

      Here is a link to the English Forums: http://www.prestashop.com/forums/forum/5-english-forum/

      All the best,

      Maggie

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>