towa/spryker-db-dump

Spryker DB Dump Tool

0.1.1 2021-08-10 12:50 UTC

This package is auto-updated.

Last update: 2024-11-10 20:27:49 UTC


README

Creates and restores database dumps for Spryker.

ONLY WORKS WITH MARIADB/MYSQL FOR NOW

Installation

Install the package:

composer require --dev towa/spryker-db-dump

Add namespace as core namespace in your configs:

$config[KernelConstants::CORE_NAMESPACES] = [
    ...
    'Towa',
];

Add console commands in the ConsoleDependencyProvider:

class ConsoleDependencyProvider extends SprykerConsoleDependencyProvider
{
    /**
     * @param \Spryker\Zed\Kernel\Container $container
     *
     * @return \Symfony\Component\Console\Command\Command[]
     */
    protected function getConsoleCommands(Container $container)
    {
        ...
        $commands[] = new DbDumpExportConsole();
        $commands[] = new DbDumpRestoreConsole();

        return $commands;
    }
    ...
}

Usage

To create a dump run:

vendor/bin/console db-dump:export

To restore a dump run:

vendor/bin/console db-dump:restore