Jump to content
thirty bees forum

Test server, development Site setup directions -- Don't modify your live site until you test on a dev site


x97wehner

Recommended Posts

I seem to need to do this irregularly and always have to look up how to do this again each time. I figured I'd just post the directions below for everyone else's benefit so they can do the same without scouring the internet. This is taken from old prestashop blogs from 1.5, so while not 100% accurate, it's still very, very close and will get you through it. The pictures on the old blog site are broken so that's why they are not included here.

Here is the link to the site (Content is pasted below) https://www.prestashop.com/en/blog/set-up-a-test-server-for-your-online-store

----------------------------------

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.

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!

 

---------------------------

How to Manually Back Up MySQL Database and PrestaShop Files

August 29, 2013
cpanel_login_6.jpg?itok=RgMxjm5T
This article is part of our Guest Blogger Series. Its content was created by Lesley Paone, a PrestaShop Global Forum Moderator (Dh42) and the owner of Nashville-based Designhaus 42.
 

How to Manually Back-Up MySQL Database

Have you ever wanted to know how to manually back up your Prestashop store? This can be really useful if you are going to upgrade your site, load a new csv file, or just to have in case anything happens to your server. Backing everything up manually is a great idea, most developers do it. Below I will show you how.

 Backing up the database

The first step is to back up the database. For this you are going to need to login to the cpanel for your site. Normally they are located at either cpanel.yourdomain.com or domain.com/cpanel. When you access it you will see this screen.

From that screen you can login to your cpanel. Usually your cpanel login is the same as your ftp login, but that is not always the case. If you are unsure of your login refer to the email your host set up when you created your account or email them and ask them for the login information. Once you are logged in, you want to scroll to the bottom and look for the phpMyAdmin icon. It is under the headings databases.

 

Click on that icon and your database management will open up and look like the image below. Click on the database that you want to backup from the left column.

 

 

When you click on your database it will open up in a view that shows all of the tables in your database. From that view click on export in the top menu, like the image below.

 

 

 Once you click on export the next screen will ask you if you want to do a quick export or a custom export. Due to the size limitations of hosts and that Prestashop 1.5 databases can get large, select custom and press ok.

 

 

The only thing you really need to select during the custom export is the compression. I recommend using gzip as the compression format, as it is universally supported.

 

 

Now press Ok at the bottom of the screen and your database will start to download.

 

Now you have a complete backup of your Prestashop database. So if anything happens to your site, you will be able to reload the database and restore it from when you last downloaded it.

-----------------------------------------------------------------------------------------------

How to Manually Back-Up PrestaShop Files via FTP

What happens to your site if your server crashes? You could lose all of your and it might take months to rebuild your store again. Never fear, I will show you how you can back up your files manually in case anything happens. I would also suggest using this in conjunction with our article on manually backing up your database.

Downloading your site

First things first, you are going to need the ftp information to log into your site. When you signed up for your web hosting you should have received an email with all of this information in it. You are also going to need an ftp program, I recommend Filezilla, it is the most popular these days. Once you have it installed, open it up, it should look like this.

 

As you can see in the image above I have highlighted where you will enter your server information. Once you have it entered you can click quick connect. Normally you will not have to enter anything for the port number, you can leave that blank.

 

Once you are logged in, depending on how your host is set up, it should look like the image below. All you have to do to back up your site is to right click on the public_html directory in the left pane and select download. If your site is very large this could take several hours.

 

The only time that your files will ever need to be backed up again is if you

  • Add new products to your site
  • Install or remove any modules
  • Install another template
  • Edit your existing template
  • Upgrade your shop
  • Or if you make any changes to core files

People placing orders or contacting your customer service will not affect the files on your site, all of that information is installed in the database. So if you never do any of the above mentioned things you will only have to back your site up once, which is awesome.

Edited by x97wehner
  • Like 2
Link to comment
Share on other sites

  • x97wehner changed the title to Test server, development Site setup directions -- Don't modify your live site until you test on a dev site

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...