There are a large number of database tables in PrestaShop 1.6, which enable it to store different types of information across the many different types of data stored in its database. You may need to back up or restore your store’s database from time to time, especially if you are having major problems.
You can add tools and extensions to your PrestaShop store if you want to automatically back up your files and folders. However, the next few lines of this tutorial will show you how to make sure you have a backup at a time when your store is in great shape.
What is data backup, and why is it important?
In case of an error, a SQL script can copy and save the stored content to get back to the original data. By using this procedure, you can provide essential safeguards for your stored data.
- In this way, potential data losses can be minimized.
- In case you are a novice to bulk data management and are unsure how to proceed, this tool can be useful.
- Having your store’s database locally will not be useful and practical since it contains all the information about your shop, which is vital for the store to operate properly.
PrestaShop Database and Files Backup
It is important to think about safety before starting anything. Making any changes to a shop could break it, so you should make sure all your data has been backed up before continuing. In essence, you need to save your files and your database.
Backing up your files
In order to back up PrestaShop, start with the files on the server where it has been installed. You already have the necessary resources to run your shop in the PrestaShop folder: the source code, the modules, themes, and pictures.
Make a copy of all your files.
To finish this step, you must copy your shop folder to a different place. It is a good idea to make an additional copy of your files on another computer, even though it can be done simply by copying them to another folder on your server. Your server or hosting provider can provide you with an FTP, SSH, and RDP client. Once the files have been copied to another location, you can download them to your computer.
It usually takes hours to complete the process, depending on the number of files and your internet connection speed. If you have full access to your server and are an advanced user, the next part may be helpful for you.
Preparing the download by compressing
The PrestaShop folder will take a long time to download one file at a time if you download it all at once. Using a server’s command line, you can compress all your content into an archive, export tables or files, and then download these files locally to make a backup faster.
For this to work, Windows-based servers need to be able to be accessed from a remote desktop. Once you have logged into your remote environment, you can go to your www folder and put its contents into a ZIP file. On Linux-based servers, SSH is required for accessing the server terminal. When logged in, go to the folder where you want to create a TAR file and use the following command. After you have copied all the files, you can delete them.
tar -czf <fien_name>.tar <folder_to_save>
Backing up your PrestaShop database
The database copy will be made with the help of phpmyadmin, a very widespread web application. It would be helpful if you added the URL where the program can be found. In most cases, it will look similar to www.your_domain.com/phpmyadmin. The address may not work, so you can try searching for it in the documentation provided by your hosting service provider.
Obtaining access to the PrestaShop database is the next step. One of the data files we have hitherto downloaded can be easily opened:
- Path to database configuration file PrestaShop 1.7: app/config/parameters.php
- Path to database configuration file PrestaShop 1.6: 1.6 config/settings.inc.php
Your file should now contain the data for users and passwords. Please copy and paste these values into the login page for phpmyadmin. Once you have opened your file, you should be able to see the user as well as password information. Paste those values into the login page for phpmyadmin. The phpmyadmin panel will appear once you log in. To make a PrestaShop database active, click the database name if you do not see a PrestaShop tables list.
Click the “export” tab to see if there is any exporting tables information from your database, for example, charts from the “prestapros16” database. Once you click on the ‘Export’ tab, use the default settings. Once everything appears to be in order, press “Go.”
You may have to wait a while for the export to complete. You can save the file when finished on the hard drive. Its size can be checked or even opened (an advanced user option). A large database can be exported as packages, or a set of “create” commands can be copied without the content of the tables.
Making a backup of your files on PrestaShop
Open your PrestaShop project and download the entire PrestaShop folder (with a remote file manager like FileZilla) to your computer to back up files. Every single file you own should be backed up. It is still possible to restore PrestaShop from a database backup, even if you have only backed up media (uploads), since your database backup might contain a plugin configuration incompatible with your updated plugin code.
If you need it, you can also use free tools that integrate with your PrestaShop. Connecting the extension to your store and opening it from the top navigation bar lets you enter your FTP service’s username, host, port, and password.
You will receive notifications when files are transferred from the store as you download them. The file should say “Queued” in the download queue. Once it has been downloaded, the bottom block should say “Successful” to show that it has been downloaded.
If you get a message that says “Failed,” it means that the download of that file did not go through. Afterwards, you will be asked to retry the download; at this point, you can skip or rescan what you have already downloaded and only redownload missing or broken files.