Note
This functionality first appeared in CS-Cart and Multi-Vendor 4.8.2.
The backup of a CS-Cart or Multi-Vendor store can be made via console. This approach has 2 advantages:
Here’s the command that makes a full backup of the store, with files and database:
php /path/to/cart/admin.php --dispatch=datakeeper.backup --p --backup_database=Y --backup_files=Y --dbdump_tables=all --dbdump_data=Y --extra_folders[]=var/files --extra_folders[]=var/attachments --extra_folders[]=var/langs
Note
Make sure to replace /path/to/cart with the actual path to your CS-Cart or Multi-Vendor installation on the server.
Parameter | Description |
---|---|
p | This parameter is necessary so that the controller (dispatch=datakeeper.backup ) would accept all the other POST parameters. |
backup_database | Determines whether or not the database backup will be created.
Y —yes.N —no. |
backup_files | Determines whether or not files will be backed up.
Y —yes.N —no. |
dbdump_filename | The name of an SQL file with the database backup. If the parameter isn’t specified, the date of backup creation will be used as a name. |
dbdump_tables[] | The array with tables that need to be backed up. If you want to back up all tables, then pass the all parameter. |
dbdump_schema | Determines whether or not to back up the database schema.
Y —yes.N —no. |
dbdump_data | Determines whether or not to save the data from the database.
Y —yes.N —no. |
extra_folders[] | An array with non-standard directories (that don’t exist in CS-Cart or Multi-Vendor by default) which need to be backed up. Specify the full path from the directory with your store’s installation. |
compress (not required) | The archive format. ZIP is used by default; if you want a TGZ archive, pass tgz . |
pack_name (not required) | The name of the archive with the backup of files and database. If you don’t specify it, the default name will be used. |
For example, here is the command that will back up the cscart_products
table with all data, as well as the var/langs and var/attachments directories:
php /path/to/cart/admin.php --dispatch=datakeeper.backup --p --backup_database=Y --backup_files=Y --dbdump_tables[]=cscart_products --dbdump_data=Y --extra_folders[]=var/langs --extra_folders[]=var/attachments
Questions & Feedback
Have any questions that weren't answered here? Need help with solving a problem in your online store? Want to report a bug in our software? Find out how to contact us.