PHPackages                             sourcebroker/deployer-typo3-database - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. sourcebroker/deployer-typo3-database

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

sourcebroker/deployer-typo3-database
====================================

Database sync for TYPO3 with deployer-extended-database.

1.1.0(10mo ago)012.9k—9%2[1 issues](https://github.com/sourcebroker/deployer-typo3-database/issues)2MITPHP

Since Feb 23Pushed 10mo ago4 watchersCompare

[ Source](https://github.com/sourcebroker/deployer-typo3-database)[ Packagist](https://packagist.org/packages/sourcebroker/deployer-typo3-database)[ RSS](/packages/sourcebroker-deployer-typo3-database/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (11)Used By (2)

deployer-typo3-database
=======================

[](#deployer-typo3-database)

[![Latest Stable Version](https://camo.githubusercontent.com/31ea431343154d728f2a47617f5270f289ca302899b8f32a01aa52c6d59409c2/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f7572636562726f6b65722f6465706c6f7965722d7479706f332d64617461626173652e7376673f7374796c653d666c6174)](https://packagist.org/packages/sourcebroker/deployer-typo3-database)[![License: MIT](https://camo.githubusercontent.com/f48f8d6cf609f5b181b9c3218a85175fe8a5809c7ea400347f39697a5d55065d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c6174)](https://packagist.org/packages/sourcebroker/deployer-typo3-database)

What does it do?
----------------

[](#what-does-it-do)

This package provides settings to use package [sourcebroker/deployer-extended-database](https://github.com/sourcebroker/deployer-extended-database) with TYPO3 CMS. It allows to sync database between instances.

Installation
------------

[](#installation)

1. Install package with composer:

    ```
    composer require sourcebroker/deployer-typo3-database

    ```
2. Put the following lines at the beginning of your `deploy.php`:

    ```
    require_once(__DIR__ . '/vendor/autoload.php');
    new \SourceBroker\DeployerLoader\Loader([
      ['get' => 'sourcebroker/deployer-typo3-database'],
    ]);
    ```
3. On each instance create a `.env` (or `.env.local`) file which should be out of git and have at least `INSTANCE` with the same name as defined for `host()` in `deploy.php`. You can use this file also to store database credentials and any other settings that are different per instance. Example for `.env` file:

    ```
    TYPO3_CONTEXT='Production'
    INSTANCE='production'

    TYPO3__DB__Connections__Default__dbname='t3base13_production'
    TYPO3__DB__Connections__Default__host='127.0.0.1'
    TYPO3__DB__Connections__Default__password='password'
    TYPO3__DB__Connections__Default__port='3306'
    TYPO3__DB__Connections__Default__user='t3base13_production'
    ```

    If you want Deployer to get database data from TYPO3 directly instead of reading from `.env` file then set:

    ```
    set('driver_typo3cms', true);
    ```

    As an alternative you can also not create any `.env` file but make sure that the env variable `INSTANCE` exists in the system at hosts defined in Deployer (and also at your local host). For example, at local ddev level you can define it in `.ddev/config.yaml`:

    ```
    web_environment:
      - INSTANCE=local
    ```

Synchronizing database
----------------------

[](#synchronizing-database)

The command for synchronizing database from production database to local instance is:

```
dep db:pull production
```

The command for synchronizing database from production to staging is:

```
dep db:copy production --options=target:staging
```

Example of working configuration
--------------------------------

[](#example-of-working-configuration)

This is an example of working configuration for TYPO3 13:

```
