beaten-sect0r / yii2-db-manager Goto Github PK
View Code? Open in Web Editor NEWDatabase Backup and Restore functionality
License: BSD 3-Clause "New" or "Revised" License
Database Backup and Restore functionality
License: BSD 3-Clause "New" or "Revised" License
Hello, my sql file is empty i am using following config:
i am using my alias from bootstrap.php
Yii::setAlias('@backup', dirname(dirname(__DIR__)) . '/backup');
in config/main.php
'modules' => [
'db-manager' => [
'class' => 'bs\dbManager\Module',
'path' => '@backup',
'dbList' => ['db'],
'as access' => [
'class' => 'yii\filters\AccessControl',
'rules' => [
[
'allow' => true,
'roles' => ['@'],
],
],
],
],
in console config
'modules' => [
'db-manager' => [
'class' => 'bs\dbManager\Module',
// path to directory for the dumps
'path' => '@backup',
// list of registerd db-components
'dbList' => ['db'],
],
],
i am getting result :
php yii dump/create -db=db -gz -s
Storage component is not configured.
Dump successfully created.
gzip file is created but with 0b size
Можно ли данным модулем без проблем настроить Бекапы?
Допустим бекапить БД каждые 3-7 днем с удалением предыдущего бекапа
There is a problem with db passwords like 4iN8@Ud71&EToWEF - it contains characters: @ & and dump failed :(
All passwords in command:
PGPASSWORD='4iN8@Ud71&EToWEF' pg_dump --host=
needs to be in inverted commas
:(
Db Manager admin page throws this
Есть ли возможность сделать бекап по крону?
Если есть - то добавить пример по крону.
Можно ли реализовать такую возможность? Запомнить это, как пресет.
Аналогия из SypexDumper
When i select database component (db) and click button. It's show 0 byte file.
my backend/config/main.php is
'db-manager' => [
'class' => 'bs\dbManager\Module',
// path to directory for the dumps
'path' => '@webroot/backups',
// list of registerd db-components
'dbList' => ['db'],
// additional mysqldump/pg_dump presets (available for choosing in dump and restore forms)
/*'customDumpOptions' => [
'mysqlForce' => '--force',
'somepreset' => '--triggers --single-transaction',
'pgCompress' => '-Z2 -Fc',
],
'customRestoreOptions' => [
'mysqlForce' => '--force',
'pgForce' => '-f -d',
],*/
// options for full customizing default command generation
//'mysqlManagerClass' => 'CustomClass',
//'postgresManagerClass' => 'CustomClass',
// option for add additional DumpManagers
/*'createManagerCallback' => function ($dbInfo) {
if ($dbInfo['dbName'] == 'exclusive') {
return new MyExclusiveManager;
} else {
return false;
}
},*/
'as access' => [
'class' => 'yii\filters\AccessControl',
'ruleConfig' => [
'class' => KpiRule::className(),
],
'rules' => [
[
'allow' => true,
'roles' => [User::ROLE_ADMIN],
],
],
],
],
.
День добрый! Модуль прекрасно работает, но при выборе опции gZip сжатия сохраняется пустой файл, в чём может быть проблема?
Some times , we not need dump all tables of db, just dump some tables?
May be ?
На OpenServer возникала указанная ошибка, в файле MysqlDumpManager.php пришлось изменить строку:
"--password='{$dbInfo['password']}'",
на
'--password='.$dbInfo['password'],
I need to backup my database and a directory with pdf files that are referenced from the database.
How can this be done using this excellent extension?
Нашел возникновние ошибки и заменил на 78 строке
с
$dumpText = fopen($dumpPath, 'r'); Yii::$app->backupStorage->write(StringHelper::basename($dumpPath), $dumpText); fclose($dumpText);
на
$dumpText = fopen($dumpPath, 'r+'); Yii::$app->backupStorage->writeStream(StringHelper::basename($dumpPath), $dumpText); fclose($dumpText);
How use customDumpOptions in console mode
When trying to get the help for the yii2 console commands on a server, I ran this:
$ yii help
and was greeted with this error message:
Error: Path is not writable! Check chmod!
This message tells me some path is not writeable, but critically, it does not actually tell me which path it tried to write, making solving the issue harder than it needs to be.
I traced it down to this file:
https://github.com/Beaten-Sect0r/yii2-db-manager/blob/master/src/Module.php#L142
You have the path available here, so please mention it in the error message.
As a developer, I want to also be able to back up my MongoDB
databases.
Help!
When i try to access to /db-manager, it throws me forbidden expection (403)
As a developer I want to store my dump file with a custom name, for example I want to execute:
php yii dump/create -db=db -s -f=database/backups/backup.sql
and get:
database/backups/backup.sql
I have a large database that takes more than 60 seconds to backup.
Is it possible to add custom timeout to prevent this to happen?
For now i have to edit manualy DumpController.php to change this...
Offending line : 73 version: 2.2.1.
By the way: great job!
Please add symfony/process 4.* support
Есть необходимость сделать определенные действия после бекапа.
Например
Пример взят из практики, и реализован на sypexDumper.
...
php service in one container,
mysql service in another container,
Use your code , in php container cant use mysqldump
to backup db?
Please to improve,thank you !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.