Jump to content

CLI backup Prestashop 8 [SOLVED]


Marz12

Recommended Posts

Hello,

did someone give a try to backup commands as explained on this page:

https://devdocs.prestashop-project.org/8/basics/keeping-up-to-date/update/update-from-the-cli/#backupcreate-command

Maybe I missed something, but when I use

php bin/console backup:create myadminfolder --include-images=1

I get

There are no commands defined in the "backup" namespace.  
                                                           
2025-08-21T14:01:13+02:00 [info] User Deprecated: The "PrestaShop\PrestaShop\Adapter\StockManager" class implements "PrestaShopBundle\Service\DataProvider\StockInterface" that is deprecated since 8.1 and will be removed in next major.
2025-08-21T14:01:13+02:00 [info] User Deprecated: prestashop.adapter.legacy_db service is deprecated and will be removed in 8.0.
2025-08-21T14:01:13+02:00 [info] User Deprecated: Not specifying the optional ShopConstraint parameter is deprecated since version 1.7.8.0
2025-08-21T14:01:13+02:00 [info] User Deprecated: Not specifying the optional ShopConstraint parameter is deprecated since version 1.7.8.0
2025-08-21T14:01:13+02:00 [info] User Deprecated: Not specifying the optional ShopConstraint parameter is deprecated since version 1.7.8.0
2025-08-21T14:01:13+02:00 [info] User Deprecated: Not specifying the optional ShopConstraint parameter is deprecated since version 1.7.8.0
2025-08-21T14:01:13+02:00 [info] User Deprecated: Not specifying the optional ShopConstraint parameter is deprecated since version 1.7.8.0
2025-08-21T14:01:13+02:00 [info] User Deprecated: __construct is deprecated since version 8.1 and will be removed in the next major version.
2025-08-21T14:01:13+02:00 [info] User Deprecated: Since api-platform/core 2.7: The service "ApiPlatform\Core\Bridge\Symfony\Routing\IriConverter" is deprecated, use ApiPlatform\Symfony\Routing\IriConverter instead.

(Up to now my backups use simple commands such as

tar -czvf backup_2025-08-21.tar.gz ../public_html
mysqldump -u usernameofthedb -p --lock-tables --add-drop-table --databases psdbname > psdb.sql
tar -czvf backup_db_2025-08-21.tar.gz psdb.sql

Does someone habe better ideas?)

Thank you.

 

My config:

Prestashop 8.2.1

PHP 8.1

 

Edited by Marz12 (see edit history)
Link to comment
Share on other sites

11 hours ago, Marz12 said:

Hello,

did someone give a try to backup commands as explained on this page:

https://devdocs.prestashop-project.org/8/basics/keeping-up-to-date/update/update-from-the-cli/#backupcreate-command

Maybe I missed something, but when I use

php bin/console backup:create myadminfolder --include-images=1

I get

There are no commands defined in the "backup" namespace.  
                                                           
2025-08-21T14:01:13+02:00 [info] User Deprecated: The "PrestaShop\PrestaShop\Adapter\StockManager" class implements "PrestaShopBundle\Service\DataProvider\StockInterface" that is deprecated since 8.1 and will be removed in next major.
2025-08-21T14:01:13+02:00 [info] User Deprecated: prestashop.adapter.legacy_db service is deprecated and will be removed in 8.0.
2025-08-21T14:01:13+02:00 [info] User Deprecated: Not specifying the optional ShopConstraint parameter is deprecated since version 1.7.8.0
2025-08-21T14:01:13+02:00 [info] User Deprecated: Not specifying the optional ShopConstraint parameter is deprecated since version 1.7.8.0
2025-08-21T14:01:13+02:00 [info] User Deprecated: Not specifying the optional ShopConstraint parameter is deprecated since version 1.7.8.0
2025-08-21T14:01:13+02:00 [info] User Deprecated: Not specifying the optional ShopConstraint parameter is deprecated since version 1.7.8.0
2025-08-21T14:01:13+02:00 [info] User Deprecated: Not specifying the optional ShopConstraint parameter is deprecated since version 1.7.8.0
2025-08-21T14:01:13+02:00 [info] User Deprecated: __construct is deprecated since version 8.1 and will be removed in the next major version.
2025-08-21T14:01:13+02:00 [info] User Deprecated: Since api-platform/core 2.7: The service "ApiPlatform\Core\Bridge\Symfony\Routing\IriConverter" is deprecated, use ApiPlatform\Symfony\Routing\IriConverter instead.

(Up to now my backups use simple commands such as

tar -czvf backup_2025-08-21.tar.gz ../public_html
mysqldump -u usernameofthedb -p --lock-tables --add-drop-table --databases psdbname > psdb.sql
tar -czvf backup_db_2025-08-21.tar.gz psdb.sql

Does someone habe better ideas?)

Thank you.

 

My config:

Prestashop 8.2.1

PHP 8.1

 

The error shows that the backup namespace is not available in your CLI. The safest way is to handle backups directly on the server side using tools like mysqldump for the database and a simple archive command for the files. This is more reliable than depending on PrestaShop’s Upgrade Assistant which is not always stable for backups.

  • Thanks 1
Link to comment
Share on other sites

Thank you for the advice.

I hope that internal tools would be better especially to backup the database. I also wanted to check if the size of the file obtained would be the same as when I use (according to https://devdocs.prestashop-project.org/8/basics/keeping-up-to-date/backup/ )

1- mysqldump --lock-tables --add-drop-table (smaller size)

2- manual export through phpmyadmin with options LOCK TABLES and  DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT / TRIGGER (bigger size)

As you said, Prestashop's tool for backup often fails with timeout.

So I'll keep my manual backup process.

Thank you again.

Link to comment
Share on other sites

  • Marz12 changed the title to CLI backup Prestashop 8 [SOLVED]

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...