PHPackages                             mukellef/database-sync - 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. [Database &amp; ORM](/categories/database)
4. /
5. mukellef/database-sync

ActiveLibrary[Database &amp; ORM](/categories/database)

mukellef/database-sync
======================

Sync database down.

01PHP

Since Jun 26Pushed 2y ago3 watchersCompare

[ Source](https://github.com/mukellef/database-sync)[ Packagist](https://packagist.org/packages/mukellef/database-sync)[ RSS](/packages/mukellef-database-sync/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Community
---------

[](#community)

There is a Discord community.  For quick help, ask questions in the appropriate channel.

Laravel DB Sync
===============

[](#laravel-db-sync)

[![DB Dync](https://repository-images.githubusercontent.com/506690782/a5b01352-4869-4e6d-8e46-d44e93c960df)](https://repository-images.githubusercontent.com/506690782/a5b01352-4869-4e6d-8e46-d44e93c960df)

Introduction
------------

[](#introduction)

Sync remote database to a local database

> A word of warning you should only sync a remote database into a local database if you have permission to do so within your organisation's policies. I'm syncing during early phases of development where the data is largely test data and not actual customer data.

Connection can be made over SSH or using a remote MySQL connection.

Install
-------

[](#install)

Install the package.

```
composer require dcblogdev/laravel-db-sync
```

Config
------

[](#config)

You can publish the config file with:

```
php artisan vendor:publish --provider="Dcblogdev\DbSync\DbSyncServiceProvider" --tag="config"

```

.env
----

[](#env)

Set the remote database credentials in your .env file

When using SSH Add:

```
REMOTE_USE_SSH=true
REMOTE_SSH_PORT=22
REMOTE_SSH_USERNAME=
REMOTE_DATABASE_HOST=

REMOTE_DATABASE_USERNAME=
REMOTE_DATABASE_PORT=3306
REMOTE_DATABASE_NAME=
REMOTE_DATABASE_PASSWORD=
REMOTE_DATABASE_IGNORE_TABLES=''

REMOTE_REMOVE_FILE_AFTER_IMPORT=true
REMOTE_IMPORT_FILE=true

```

For only MySQL remote connections:

```
REMOTE_DATABASE_HOST=
REMOTE_DATABASE_USERNAME=
REMOTE_DATABASE_PORT=3306
REMOTE_DATABASE_NAME=
REMOTE_DATABASE_PASSWORD=
REMOTE_DATABASE_IGNORE_TABLES=''

REMOTE_REMOVE_FILE_AFTER_IMPORT=true
REMOTE_IMPORT_FILE=true

```

Set a comma seperate list of tables NOT to export in `REMOTE_DATABASE_IGNORE_TABLES`

To generate a SQL with a custom file name `REMOTE_DEFAULT_FILE_NAME`

To specify a different local database connection:

```
LOCAL_TARGET_CONNECTION=different_mysql_connection

```

Set the mysql command path:

```
LOCAL_MYSQL_PATH=/usr/bin/mysql

```

For only mysqldump:

```
REMOTE_MYSQLDUMP_SKIP_TZ_UTC=true

```

Usage
-----

[](#usage)

To export a remote database to OVERRIDE your local database by running:

```
php artisan db:production-sync
```

Provide a filename for export on the fly by passing the option --filename, remember to provide .sql

```
php artisan db:production-sync --filename=other.sql
```

Run the command without attempting to export:

```
php artisan db:production-sync --test
```

Aliases
-------

[](#aliases)

There are shortcuts that can be used:

`-T` = will use `--test``F` = will use `--filename`

Alternative name
----------------

[](#alternative-name)

When connecting to a none production database, say a staging database you can choose to use this alternative name:

`db:remote-sync` may be used instead of `db:production-sync`

###  Health Score

12

—

LowBetter than 0% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1975129?v=4)[raci](/maintainers/racibaz)[@racibaz](https://github.com/racibaz)

![](https://www.gravatar.com/avatar/e5016ba85c9f4050f6b608a79aa6467f071f56bd320bf5a118befb5873821c1c?d=identicon)[atakandemirkir](/maintainers/atakandemirkir)

---

Top Contributors

[![racibaz](https://avatars.githubusercontent.com/u/1975129?v=4)](https://github.com/racibaz "racibaz (4 commits)")

### Embed Badge

![Health badge](/badges/mukellef-database-sync/health.svg)

```
[![Health](https://phpackages.com/badges/mukellef-database-sync/health.svg)](https://phpackages.com/packages/mukellef-database-sync)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198741.5k12](/packages/pgvector-pgvector)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
