Author Archives: admin

Prestashop permanentLinks block problem when doing profiling

Sometime when we are trying out new things on the shop all of a sudden the testpage just stops working and refers to an error with the permanent links block.

Up until now I have not been able to understand why. If we look at the page source it is referring to a cms-link that is missing pointing to the smarty cache.

Up until today the only solution has been to restore the last update of the shop. Today however I tried to turn off profiling and then the shop was working again. When turning profiling on again the page still loads ok so it seems are dosing a profiling restart might solve the problem. Keeping this post as a mental note in case it happens again.


Clone Prestashop

Have you ever thought that, “I will just test this module quickly” or “I will just modify this stylesheet” and you end up with more work or more problems than expected.

The proper way is to setup a clone (an exact copy) of your original shop and test the changes first. Once you know that it is working, do the same thing in the live installation.

Step 1: Create a subdomain for your test shop

In my opinion the best way to setup the testshop is to use a separate subdomain (or even a totally different domain. If your hosting provider does not allow you to create more subdomains you will have to put the test site in a normal subfolder on your server.

Creating a subdomain is simple. After logging into Plesk just go to the Websites & Domains and at the bottom of the page you will find these options:
add subdomain in plesk
Select “Add new subdomain” and enter the name of the new subdomain and the folder on the server where you want to put the test site. In our case we call it “perf” which means the testsite will be available in Normally you want to name the subdomain and the folder the same.

Step 2: Copy the files we need for the prestashop clone

We will work through Plesk in this guide since it is much faster than downloading the full shop over ftp just to upload it again.

In the same Website & Domains, click on File Manager:
plesk file manager

and if your Prestashop is installed in the default httpdocs folder, click on that folder and you will see a long list of the Prestashop files.

Important: Now we must select all files. Find the word “All” to the right on top of the file list and click it.

Now all files are shown on one page. Select the checkbox to the left in the file manager header:

Now all files and folders are selected and the file list looks like this:

Click the Copy/Move button:

and you are taken to a confirmation screen where you need to also enter the destination directory.
Important: If you are using a subdomain, remember to remove the /httpdocs/ and just enter the folder name like in our example:

and when it has completed you will return to the FileManager with a success message.

And we are done with the transfer of the Prestashop files.

Step 3: Create a new database for our Prestashop clone

Go back to Websites & Domains and click on the Databases icon.
Choose “Add new database”

In the next screen just give the database a proper name. We have chosen “perf” to match the name of the subdomain.

Step 4: Create a user for the database

Now just click on the “add new database user” icon.

Choose a name and password for the database user. You can pick anything. For simplicity we have chosen givensa_perf to have a prefix “givensa” and a connection to the test site “perf” so we do not risk mixing it up with other databases.

Step 5: Importing the original database

Before importing anything, we would have to export the original database. How to export a database is already explained in How create a Prestashop database backup. Please refer to that article and then come back here for the next step when you are done.

Now ensure that you are back at the page with your newly created database (in our case the one called perf). Then click “Webadmin”

and you will enter the phpMyAdmin tool which allows us to import an existing database. In the menu there are not so many options at this time. Simply click “Import”

Click choose-file

and choose the database you just Exported. Click “Continue” and wait for a while for the database to be imported.

Wow thats awesome, now we have the files copied and we have a database uploaded. However the database contains some info from the live site that we need to change.

Step 6: Modifying the database to work with the Prestashop copy

One the left side find the table called ps_configuration prestshop-config

and click on it.

Change the Number of Rows field to show 3000 instead of 30 and press Enter so we can easily search the whole database.

Search on the page for the field called PS_SHOP_DOMAIN and when you find it, below you also see PS_SHOP_DOMAIN_SSL. Change both of them to the new url of the test site. In our example we will insert perf in front of the domain name.

If your prestashop version is 1.5 or higher. You also need to find the table called ps_shop_url and make the same changes so it looks something like this:

Step 7: Updating our database settings to match the new database

Now when we have the database imported, we must tell Prestashop which database to use. In the copy we made previously Prestashop still wants to look at the original database and this is definetely not what we want.

So, go back to Websites & Domains and click again on the File Manager. Go inside the folder of our new testsite (in our case it is /perf/) and click on the config folder and locate the file and click on the pen icon to edit the file.

Change the fields DB_USER and DB_PASSWD to match the credentials we set earlier. In our case we entered givensa_perf for both. If you old settings does not say:
define(‘_DB_SERVER_’, ‘localhost’);
you will have to enter the name of the new database in that field (in our case it would be “perf”).

Now Prestashop will be able to use the correct database.

Step 8: Updating our .htaccess file

In order for things to work we must regenerate the .htaccess. This we do from the Prestashop admin interface so go to and under the Preferences tab select SEO & URLs.prestashop_perf_tab

In order to make Prestashop rewrite the .htaccess file, all you have to do is click the Save button.

Fantastic, if you now go to your test site (in our case it is you should see it working.

Congratulations, you have created an identical copy of your prestashop site. In order to finish up nicely, we would not like for Google to index this site so we add a robots.txt that blocks all search engines from browsing our test installation.

Add blocking robots.txt for the Prestashop test site

Go back to the File Manager in Websites & Domains and find robots.txt in your test site folder. Click on the pen to edit it. Delete all info in the file and add these lines:
User-agent: *
Disallow: /

Now search engines will not crawl your test site.

Finishing up

Now everything should be in order and you are ready to start hacking around in your test installation. I hope you find the tutorial useful and if you have any comments or found errors or things that could be more clear, do not hesitate to let me know by posting a comment below.


How create a Prestashop database backup


Sometimes when making changes in Prestashop I feel that we loose control. You unhook one module and the whole site explodes (or maybe implodes) and it might be hard to understand what happened.

In these scenarios as always the recommendation is to backup the site and the database. However if you are on a standard ftp connection with your hosting provider, downloading the whole shop might take a very long time.

If you are just testing new modules or trying to remove some Prestashop modules to make your site faster, then it might be enough just to make a backup of the database. This way if things go bad, you can just restore this backup and you are back where you started with a working shop.

In this example we will show how to make a backup using Plesk. The good thing with this approach is that it is generic so it applies for any mySQL database, Prestashop, WordPress etc and since we normally do a lot of things like copying files and editing configs through Plesk rather than through ftp it is starting to feel like a familiar environment.

Getting started

Start by logging into Plesk with your username and password provided by your hosting company. You will see a screen of the

Finding the database to backup

If you click on the tab called “Websites and Domains” and then on “Databases” you will get into the Plesk database page. plesk-databases
Find the database that is attached to your Prestashop installation.

Click on the webadmin button

prestashop database for backup

Database for backup

and you will get into the phpMyAdmin tool.
phpMyAdmin prestashop
Where you will see a huge table of database info. You can just ignore all that.

Exporting the database

Now just click the Export button:
and click Continue.

Now a download of your database will start automatically and you are done.

As long as you only modify things from the Prestashop admin, if anything goes wrong it can usually be restored by simply Importing this Prestashop database again. How to Import a Prestashop database backup is explained in this blogpost.

Two wordpress blogs with one database

One of the first “problems” that occured when starting this blog was that we are using shared hosting and our provider only permits us to have 3 databases with our current subscription.

So we use one database for the shop and another one for the blog and the last one for our test installation of Prestashop running a clone of the Givensa site for evaluation of new features.

This leaves us without databases for a new blog. There are two main options for solving this, a WordPress Network or running two WordPress blogs in one database. In this blogpost we will concentrate on the second option and give a complete tutorial with step-by-step images on:

How to install to WordPress blogs with one database

Step 1 – Check WordPress version for the existing blog

This step is more a matter of precaution. If you are on the same main installation of WordPress like v3.x it is probably safe to download any 3.x version of WordPress in step 2. However, in order to be on the safe side, I decided to download and install the exact same version for the second blog. Since the 2 WordPress blogs will share the same database it just feels safer that both installations are exactly the same.

You can easily check the version of running blog by going to the readme.html file. In our case it is simply:

And you will see something like this:

How check wordpress version


Step 2 – Download a specific WordPress version

If you go to you normally only find the latest official release. What we are looking for is a specific version and these can be found by clicking Download and the choose Release Archive on the left. Then you will be presented with a list of all previous WordPress releases, like this:

download old WordPress release

Download old WordPress release

Choose the version your other blog used and download it.

Step 3 – Upload the WordPress files to your server via ftp

Before we can install WordPress on our server we have to upload it. We will do this with and ftp client, in our case Filezilla which is free and can be found at the Filezilla project site.

Start Filezilla, enter the username and password you have for your hosting account and login to your ftp server.

Now the first thing we need to do is to decide if the blog should go in a subdomain like or in a subfolder like The method you choose might have some impact on SEO and there are plenty of articles on this topic on the internet so have a look around if you are unsure. In our case we will install WordPress in a subfolder of our main site. This means that no subdomain needs to be created (which might also be restricted from the hosting provider). However we need to create a subfolder inside our httpdocs folder of the main domain.

In Filezilla creating a new folder is easy, just rightclick in the pane of the ftp server and select “New Folder” and you will end up with something like this:

Now you need to unpack the WordPress package we downloaded previously. Normally it is enough to just double click on the downloaded file and it should unpack automatically. When you look into the folder where the WordPress package was unpacked it will look something like this image:

wordpress unpacked folder

WordPress unpacked folder

The final part of this step is to upload the WordPress files to the folder we just created on our ftp server. On the left side of Filezilla, select all files in the folder where WordPress was unpacked. On the right side, make sure you have entered into the folder we just created for the new blog. In our example for this blog, it looked like this:

Great, now we have WordPress uploaded to our own webserver, well done.

Step 4 – Installing WordPress

Now all we have to do is to start our favorite web browser and go to the address of our blog. In our case it is You will be presented with some very basic installation questions like in this image:

wordpress online installation

WordPress online installation

Fill out the questions, finish the installation and you will be presented with this message:

Step 5 – Changing the WordPress database prefix

Now we have reached the final and only really “technical” point of this tutorial. In order to be able to use two WordPress blogs with one database you must use different indexes for the databases. The first one will probably have wp_ as default. We will choose a unique prefix for the fields we need for the new database for this blog. This will allow us to have two WordPress blogs on the same database.

This prefix is defined in a file called wp_config.php and you find it in the root folder of your newly created blog (the folder we created in step 3 above.

You can either download this file with Filezilla and edit it locally or if your hosting provider offers you a web interface with a File Manager like Plesk, you can edit this file online through the browser.

Once you have access to the file you have to locate the field $table_prefix. Change the default value wp_ to something that you think suits your blog. I have choosen lebd_ my file will look like this image:

Change WordPress database prefix

Change WordPress database prefix

Step 6 – Finishing

Congratulations. You have completed a full installation of a second WordPress blog sharing database with another blog.

Now you should be able to just goto the address where you installed the blog and you will see the Hello World post.