DavidM
DavidM

Reputation: 307

Prestashop export database and import it back

I'm new to Prestashop and I'm using Prestashop 1.6.1.17.

I want to export the database of my Prestashop site and back it up in order to make some modifications to the online database. However, I want to make sure that if something wrong happens I can import the just exported database and have it working again as before.

If so, should it work the same way as before exporting the database?

Besides, what if I made the database backup and then installed some modules that didn't work, or made some other back office modifications that went wrong, would the site work the same way as before after importing it back?

Just for general knowledge.

Upvotes: 0

Views: 1075

Answers (1)

Javier Elices
Javier Elices

Reputation: 2154

Prestashop is comprised of a database and a filesystem. Backing up the database will allow you to recover from changes to the database, but not from changes to the filesystem. If you are going to use the "DB Backup" option under "ADVANCED PARAMETERS" bear in mind that a live shop may change while doing the backup, so it is better to do it while offline.

The restore operation will first drop all tables, so you have to make sure that your backup files are not corrupted before doing the backup.

The database is only half of it. A full backup will require to backup all the files. That may be done in many ways. The easiest one could be by setting the shop offline and then using an ftp client to copy all the files. This may be slow depending on the server and connection speed.

When you install a module, it will create a directory under <prestashop root>/modules. If the module is developed following standards, this directory will not clash with other core modules. However, a module installation may do lots of other things. It is always a good idea to install modules from sources that you trust. Also, a module is just a ZIP file that should have a single directory containing all its files. You may check the contents of the ZIP file to make sure.

A well developed module that behaves properly is easy to disable or uninstall. However, the installation scripts of the module (or uninstallation) may do any number of wrong things as well.

In general, backup both the database and the filesystem regularly and especially if you are going to try something with side effects. Installing a module may be one of those things, but modifying files here and there following instructions from someone's blog may be too. Changing a template usually involves changing .tpl files. Sometimes you may want to change .css files. Those changes have nothing to do with the database.

Upvotes: 1

Related Questions