Database migrations for Bitrix and more
-
composer config repositories.arrilot/bitrix-migrations vcs https://github.com/informunity/bitrix-migrations.git
-
composer require arrilot/bitrix-migrations
-
cp vendor/arrilot/bitrix-migrations/migrator migrator
- copy the executable file to a convenient location. -
Open the
migrator
file and make sure the correct $_SERVER['DOCUMENT_ROOT'] is set. Change the settings if necessary. -
php migrator install
This command will create a migrations
table in the database to store the names of completed migrations.
Default:
-
The table is called
migrations
. -
composer.json
andmigrator
are in the root of the site. -
Migration files will be created in the
.migrations
directory relative to the file copied in step 3.
If necessary, all this can be changed in the copied migrator
file.
It is highly recommended to make migrator
and .migrations
unavailable via http through the web server.