package backup limit #1844
Replies: 11 comments
-
Hi, the command supports passing "db-name" array of databases for backup. See command signature. This can be run from command line: Please note, that all databses must be configured in order to backup them. |
Beta Was this translation helpful? Give feedback.
-
Bonsoir,
Voici comment jai procedé mais cela ne fonctionne pas. Je n'arrive pas à
zipper mes base de données.
$databases = ['magasin', 'game_226', 'gestion_budget_vaccination'];
Artisan::call('backup:run', ['--db-name' => $databases]);
Dans mon backup.php
'databases' => [
'mysql','magasin', 'game_226', 'gestion_budget_vaccination'
],
Le lun. 23 sept. 2024 à 15:51, Michal Štván ***@***.***> a
écrit :
… Hi, the command supports passing "db-name" array of databases for backup.
See command signature
<https://github.com/spatie/laravel-backup/blob/f88bd1192f9e783230bbc38790aecdcf3d7643bf/src/Commands/BackupCommand.php#L18>
.
This can be run from command line:
php artisan backup:run --db-name=db1 --db-name=db2
or programatically:
Artisan::call('backup:run', ['--db-name' => ['db1', 'db2']]);
Please note, that all databses must be configured in order to backup them.
—
Reply to this email directly, view it on GitHub
<#1844 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOK2CMZ4WY4KAGUZKFKG5XLZYA2JTAVCNFSM6AAAAABOUQGTDCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTANZSHAZTMNI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
What's the error? Do you have the databases configured in database.php config? |
Beta Was this translation helpful? Give feedback.
-
ça ne me presente pas d'erreur. Il zippe seulement le projet en question.
Dans mon database.php je nai rien modifié. Dois je le modifier? Si oui
comment?
Le lun. 23 sept. 2024 à 16:28, Michal Štván ***@***.***> a
écrit :
… What's the error? Do you have the databases configured in database.php
config?
—
Reply to this email directly, view it on GitHub
<#1844 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOK2CMY6URRS4BEZG7KG3BLZYA6UPAVCNFSM6AAAAABOUQGTDCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTANZSHA4DANA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Every database you want to backup must be defined as a conneciton in database.php:
And in backup.php (you have this correctly). PS, if you dont want to backup the files, comment out this in backup.php:
|
Beta Was this translation helpful? Give feedback.
-
If all the databases share common configuration, you can generate the connections with a simple generator like this:
|
Beta Was this translation helpful? Give feedback.
-
For more flexibility it might be better to use command line utility like |
Beta Was this translation helpful? Give feedback.
-
Bonjour,
Ya t'il une possibilité de préciser le fichier à restaurer? en passant en
parametre le fichier à restaurer dans ma fonction. Jai tenté de le faire
mais je narrive pas
comme ceci:
$process = new Process([
'php',
'artisan',
'backup:restore',
'--disk=backup',
'--backup=latest',
'--file=' . $file_name,
'--connection=' . $dbConnection,
'--password=' . $dbPassword,
'--reset',
'--no-interaction'
]);
Le lun. 23 sept. 2024 à 18:48, Michal Štván ***@***.***> a
écrit :
… For more flexibility it might be better to use command line utility like
mysqldump and do the backup yourself.
—
Reply to this email directly, view it on GitHub
<#1844 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOK2CM2IMHH7XA6Y4QCXIOLZYBO7LAVCNFSM6AAAAABOUQGTDCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTANZTGAYTKMY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
There is no restore command, that would be a really bad idea. Restore must be done manually. |
Beta Was this translation helpful? Give feedback.
-
Hello, how are you?
When I back up my database using mysqldump, I receive a warning in my SQL
file that I understand well.
Here is the warning in my SQL file: mysqldump: [Warning] Using a password
on the command line interface can be insecure.
However, when I use the backup:run command, there is no warning. I would
like to know how I can remove it in my SQL file with the method below."
$command = sprintf(
'C:\laragon\bin\mysql\mysql-5.7.33-winx64\bin\mysqldump -u %s -p
%s -h %s -P %s %s > %s 2>&1',
escapeshellarg($server->db_username),
escapeshellarg($server->db_password),
escapeshellarg($server->db_host),
escapeshellarg($server->db_port),
escapeshellarg($db['name']),
escapeshellarg($backupFile)
);
Le lun. 30 sept. 2024 à 10:11, Michal Štván ***@***.***> a
écrit :
… There is no restore command, that would be a really bad idea. Restore must
be done manually.
—
Reply to this email directly, view it on GitHub
<#1844 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOK2CMZQKTHTR6RPXJJQ5LDZZEPU7AVCNFSM6AAAAABOUQGTDCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTANZZGY2DQMQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Store your credentials in a file and use option --defaults-extra-file=credentials.cnf option. (this is the same way spatie db dumper does it, you can take a look at that package)
https://dev.mysql.com/doc/refman/8.4/en/mysqldump.html#option_mysqldump_defaults-extra-file |
Beta Was this translation helpful? Give feedback.
-
Hello,
How are you?
Thank you very much for the backup package. I wanted to create a very dynamic process, but I'm limited. I want to be able to back up the databases that are on my server. What I noticed is that the package doesn't allow it. The idea is to allow the user to select the databases from their server before starting the backup. Can you help me?
Beta Was this translation helpful? Give feedback.
All reactions