Download the PHP package enanobots/m2-dbdumper without Composer

On this page you can find all versions of the php package enanobots/m2-dbdumper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package m2-dbdumper

Open Source Love

Qoliber DbDumper

This module was designed simply to create advanced database dumps for Magento 2 Open Source Projects. It does work on Adobe Cloud and Adobe Commerce, but you need to download files manually (this might be changed in the future releases of this module)

Ok, But why?

It is very simple! Because we can! But in all seriousness, Magento 2 has been on Market a long time and nobody has created a module that out of the box has the following features:

So, that is why this module was developed.

Installation

Installation is via composer

After installing the packages just run:

Requirements:

Tested on:

WIKI

This section will describe how the module is designed. So let me start with:

Export Modes

This module allows you to create any database export profiles you wish, however I've called them Export Models. The main Export model implements ExportModelInterface and all Export Models are defined as VirtualTypes so you can add any custom Export Model you wish.

In this first release of the extension, Export Model has 4 params:

An export model is defined in the di.xml, this module has 2 additional Export Models:

You can find this in the di.xml file:

Those export models need to be added to the DumpInterface exportModels argument in the di.xml

You can define as many export models as you want.

Table Groups Interface

The main part of this module is based on an assumption that Magento 2 tables can be divided into table groups. A group of tables is a VirtualType that uses a TableGroup model, which implements TableGroupInterface. The role of a group is simply to specify a set of actions that can be or should be performed on all tables in the table group so we don't have set this for every single table defined in the database - although it is possible, it would make the di.xml file too large to maintain.

In this initial version of the module a group can have 3 group modes, defined by groupExportMode in di.xml:

Table Group export mode is overwritten by the CLI param set when running the export manually.

Grouping Tables by % character

It is not require to define all database tables, you can specify a wildcard with the % character and use it like this:

The code will find all matching tables by running proper queries on the database.

Table Export Interface

This is the main interface that transforms data from the database into

and puts it into a database dump file

A default list of restrictedColumns is defined in the di.xml. If a table needs to be anonymized (which is defined by a TableGroup the table belongs to) table is checked if any of the columns match the restricted column list. If a column is found in the restrictedColumn list, value from that table row will be "faked" or anonymized.

Example: email anonymization

Email DataFakers (or anonymizer) has 2 additional arguments:

and has 2 methods:

if you check the Firstname DataFaker class you will see that it is using modulo division.

It is on purpose, so each time you download the database, you will get matching, but randomized names or email for the same ID. When you work with the team and debug some sales / customer data, it is important to identify data not just by an ID.

Working in CLI

To start DB dump operation you can simply start the following command in CLI:

This will initiate the dump command. For example, let's use an export mode that is not defined:

you will get the following result:

In the custom Export Model, system will ask you what to do with tables that are not defined in a table group:

by typing 0, 1 or 2 you can

Recommended actions:

It is recommended to create your own module and add tables to a specified group for every project you manage:

Example:

di.xml in your custom module

Important!

Types of data:

The main Module assumption is that we have 3 sets of data:

Based on those assumptions multiple interfaces were created:

Release Notes & Change log

1.0.0

Plans and next versions of the module:


All versions of m2-dbdumper with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package enanobots/m2-dbdumper contains the following files

Loading the files please wait ....