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.
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
[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]
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!