Prestashop Guide : How to transfer/move Prestashop to a new server : 13-12-2012
Transferring your prestashop site over to a new server is actually quite simple assuming you have the right guide to follow! The below guide will show you every step involved in great detail.
Please note this guide assumes you have purchased Prestashop hosting either from Squirrel Hosting or another company.
Step 1 : Check your Prestashop Version and update!
It's always best to make sure your Prestashop site is running the latest version before starting a transfer. You can do the below guide without updating but if any errors occur it may be harder to get the help needed.
Step 2a : Backup your old Prestashop site automatically
Some hosting companies (ourselves included) have a 1 click backup facility on the server. This backs up all the necessary files and databases needed to run your website. If you have this feature on your old host, I recommend using it as it's quicker and easier! Also if you do have this feature you can skip to step 3!
Step 2b : Backup your site manually : Prestashop FTP Backup
OK so you need to backup your files but you're not sure how? Well the first thing to understand is prestashop is split into two sections;
- Files: these are the files needed to load your website, these include images and coding pages (html php etc)
- Database : This is a storage of all the page information, text and much more related to your Prestashop site
Without both of these your site wont function. Therefore we need to back both of them up. Backing up the files can be done via FTP. Don't worry this is actually quite easy to do and is described below.
First contact your current hosting company and ask them for the FTP connection details. These will include
- FTP Host
- FTP User name
- FTP Password
- FTP Port number (usually 21)
and can often be found in your old hosting control panel.
The next thing we need to do is get a program which is capable of accessing your hosting via FTP. We use the Filezilla Client (avaliable free here http://filezilla-project.org/) and instructions below are based on this program.
Open up FileZilla (on windows PC, click the windows icon in bottom left, click all programs, click FileZilla FTP Client, click FileZilla) and enter your host, user name, password and port number at the top of the page. Then click connect.
You should now be connected to your hosting and should see a series of folders in the right pane. We need to navigate to your public directory. This is usually called Public_html or htdocs. Double click it to open it. If you have installed Prestashop into a sub folder e.g. www.yoursite.com/shop then you will need to navigate to that folder.
Once you are in your Prestashop directory you should see a list of prestashop files. These include but are not limited to products-comparison.php, order.php and index.php. If you can see these files you are in the right directory. The next thing we need to do is download all these to a folder on our computer. In this case we will download them to a folder on our desktop called old site. To download all the files at once windows users can click on any file once then press and hold the CTRL keyboard key and press the letter A. This will highlight all the files. Then you left click on any highlighted file and whilst holding down the mouse button move the mouse over the old site folder, then release the mouse button.
If you did this correctly you should see a lot of green and black writing appear at the top and files should start appearing in the 'old site' folder on your desktop.
Once FileZilla has finished downloading, the text will stop scrolling and display something along the lines of 'File transfer successful, Status: Disconnected from server'. Check the files are in your old site folder and if so you can now close FileZilla.
Step 2c : Backup your site manually : Prestashop MySQL Database Backup
The next thing we need to do is backup your Prestashop Database. To do this we will use phpMyAdmin. Contact your current hosting company and ask them for information on how to access phpMyAdmin. You can usually access it via your hosting control panel, it usually has an icon like the one below.
Once you've found it, open it up and look for your Prestashop Database on the left. The database usually has the term Presta or shop in it.
TIP: If you have more than one database and don't know which one is your Prestashop shop, look in the folder you downloaded your site files to (old site) and open the folder 'config'. In here you should see a file called settings.inc. Open this up with a text editor such as notepad and you will see the following;
define('_DB_SERVER_', 'localhost'); define('_DB_TYPE_', 'MySQL'); define('_DB_NAME_', 'DATABASE NAME'); define('_DB_USER_', 'USERNAME'); define('_DB_PASSWD_', 'PASSWORD'); define('_DB_PREFIX_', 'ps_');
Whatever is written in DATABASE MAME is the name of your database.
Click your Prestashop database to load it up.
Next, click the export tab at the top.
Click on the custom radio button to load up more options.
Make sure to choose Zipped from the export database compression dropdown
Leave all the other options as they are and click the go button.
It should ask you to download a file to your computer. Save this next with your 'old site' folder.
You now have a full backup of your Prestashop site
Step 3 : Set up a new database on your new hosting.
The next step to getting your Prestashop transfered over to your new hosting is to set up a new database on your new hosting. Most hosting companies have a feature in the control panel which will allow you to do this. The instructions below are for Squirrel Hosting customers. Non Squirrel customers, ask your Hosting company how to set up a new database and access it via phpMyAdmin
Squirrel Hosting customers, click the control panel in the top right at www.squirrelhosting.co.uk.
Enter your user name and password then click 'login'.
Scroll down and Click 'Manage your hosting'.
Click 'Load eXtend Control panel' next to the domain name you want to install prestashop on to.
In the pop up window, click the MySQL icon
Under the 'Create a MySQL Database' section enter a user name and password, try and include a number and one capital character to make it more secure. Then click the 'create' button.
You have now made a blank database for your Prestashop site.
Note down the Username / Password as you will require these later. Click the 'now' button next to your database to load up phpMyAdmin.
Step 4 : Insert your Prestashop Database.
Next we need to insert our old Prestashop database into our new one. To do this, click your new prestashop database on the left hand side.
Click on the import tab.
Click the 'Choose File' button and select your old mysql database file (the zip file we downloaded in step2c)
Once complete, you should get an 'import has been sucessfully finished' message.
You can now close any phpMyAdmin windows you have opened as the database bit is finished.
Step 5 : Edit your Prestashop's config/settings.inc File
Your settings.inc file will have your old Prestashop database user name and password. For the new site to work you will need to update these to the new user name and password you made earlier on in step 3.
Open up your old site folder (where you downloaded Prestashop to on your computer) and double click the config folder to open it up. You should see a file called settings.inc. You will need to open this in notepad or a similar program to edit it.
TIP: Never open this with Microsoft word or another rich text program, it will corrupt the file! Use a plain text editor such as notepad.
Once you've opened the file, you should see something like;
<?php define('_DB_SERVER_', 'localhost'); define('_DB_TYPE_', 'MySQL'); define('_DB_NAME_', 'OLD database name'); define('_DB_USER_', 'OLD database username'); define('_DB_PASSWD_', 'OLD database password'); define('_DB_PREFIX_', 'ps_'); define('_MYSQL_ENGINE_', 'InnoDB'); define('__PS_BASE_URI__', '/'); define('_PS_CACHING_SYSTEM_', 'MCached'); define('_PS_CACHE_ENABLED_', '0'); define('_MEDIA_SERVER_1_', ''); define('_MEDIA_SERVER_2_', ''); define('_MEDIA_SERVER_3_', ''); define('_THEME_NAME_', 'prestashop'); define('_COOKIE_KEY_', 'randome key'); define('_RIJNDAEL_KEY_', 'random key'); define('_COOKIE_IV_', 'sLSoQzWS'); define('_RIJNDAEL_IV_', 'b2AQ12ExO/mbF2CHgVHBcA=='); define('_PS_CREATION_DATE_', '2012-12-12'); define('_PS_VERSION_', '22.214.171.124'); ?>
We will need to change the _DB_NAME_ (database name), _DB_USER_ (database username) and _DB_PASSWD_ (database password) to match your new database.
<?php define('_DB_SERVER_', 'localhost'); define('_DB_TYPE_', 'MySQL'); define('_DB_NAME_', 'NEW database name'); define('_DB_USER_', 'NEW database username'); define('_DB_PASSWD_', 'NEW database password'); define('_DB_PREFIX_', 'ps_'); define('_MYSQL_ENGINE_', 'InnoDB'); define('__PS_BASE_URI__', '/'); define('_PS_CACHING_SYSTEM_', 'MCached'); define('_PS_CACHE_ENABLED_', '0'); define('_MEDIA_SERVER_1_', ''); define('_MEDIA_SERVER_2_', ''); define('_MEDIA_SERVER_3_', ''); define('_THEME_NAME_', 'prestashop'); define('_COOKIE_KEY_', 'randome key'); define('_RIJNDAEL_KEY_', 'random key'); define('_COOKIE_IV_', 'sLSoQzWS'); define('_RIJNDAEL_IV_', 'b2AQ12ExO/mbF2CHgVHBcA=='); define('_PS_CREATION_DATE_', '2012-12-12'); define('_PS_VERSION_', '126.96.36.199'); ?>
These are the details you wrote down at the end of step 3. On Squirrel Hosting your _DB_NAME_ will be the same as your _DB_USER_. Once you have made the changes, click save.
Step 5 : Upload your files to the new server.
The final step is to upload all your old Prestashop files to the new server. To do this you need to connect via FTP and drag the files from the 'old site' folder onto the new hosting public_html (or htdocs) folder.
Squirrel Hosting users can find their FTP details (and unlock the FTP) using the below guide. If you're using another company, you will need to ask them for your new FTP details.
Log into your squirrel hosting account at www.squirrelhosting.co.uk and click 'manage web hosting'. Then click, 'Load eXtend Control panel'. Once loaded, scroll down and on the right hand side you should see a box labelled 'unlock FTP'. Choose 1 Hour from the options and click the unlock button.
Next scroll down a bit further and you will see your FTP Host/server user name and password. Write these down.
Next, open up FileZilla and enter your new host's connection details (the ones from above) in the boxes at the top. For Squirrel Hosting you may leave the port blank.
Next, double click on public_html or the equivalent folder if using another hosting company.
Next we need to upload all the files we downloaded from your old host. Locate the folder where these files are stored (old host) and highlight all the files in the folder (CTRL+A). Finally left click on the files and drag them over onto the empty public_html folder window.
That's it! Once the files are transfered you should be able to view your new site.
If you have any issues or would like further help with a transfer please open a support ticket where one of our staff will be happy to help.
Spotted anything you think is wrong or could be done better, not a Squirrel Hosting customer but stuck using this guide? Drop a comment below and we'll see if we can help.
Comment on this post
Did you find this blog post helpful? Let us know in the comments below.