<p>The way we do it is we take a copy of the live database when we begin development work, do the dev work on local/stage, get sign off... then manually add the new fields etc onto the live database. Otherwise, you're going to lose data.</p>

<p>I don't know of any way you could automagically merge two different databases.</p>

<p>One method to help speed up copying fields from one database to another (which is what you're doing) is to use the <a href="https://github.com/engram-design/FieldManager" rel="nofollow noreferrer">Field Manager</a> plugin, which can export fields as JSON from your staging version, and you can import that JSON using Field Manager again on the live version. You'll still need to manually assign those fields to the associated sections.</p>

CC BY-SA 3.0
2017-08-16T12:47:37.973Z
2017-08-16T12:47:37.973Z
Matt Wilcox
<p>Another way you could try is to check out <a href="https://nystudio107.com/blog/database-asset-syncing-between-environments-in-craft-cms" rel="nofollow noreferrer">Database &amp; Asset Syncing Between Environments in Craft CMS</a> written by @nystudio107 on the Slack channel. I'm sure he'd be able to help with any sticking points.</p>

CC BY-SA 3.0
2017-08-16T13:19:23.310Z
2017-08-16T13:19:23.310Z
Damon
<p>Scenario:</p>

<ul>
<li>Live server where customer adds content and articles, which are store
in the database</li>
<li>Staging server where we add new functionality, fields, sections and more</li>
</ul>

<p>When the development of the new functionality on the staging server is complete, it should be merged with the new content of the live server.</p>

<p>How easy is this to handle? Is it as easy as just importing the staging db server into the live server one? Will not existing content be overwritten?</p>

<database><multi-environment>
What is the most adviceable way to combine a staging and live database?
# What is the most adviceable way to combine a staging and live database?

(Asked by: username_0 on 2017-08-16)

Scenario:

* Live server where customer adds content and articles, which are store
  in the database
* Staging server where we add new functionality, fields, sections and more

When the development of the new functionality on the staging server is complete, it should be merged with the new content of the live server.

How easy is this to handle? Is it as easy as just importing the staging db server into the live server one? Will not existing content be overwritten?

**Tags:** database, multi-environment


---

## 2 answers

### Answer by username_1 on 2017-08-16. Score: 3

The way we do it is we take a copy of the live database when we begin development work, do the dev work on local/stage, get sign off... then manually add the new fields etc onto the live database. Otherwise, you're going to lose data.

I don't know of any way you could automagically merge two different databases.

One method to help speed up copying fields from one database to another (which is what you're doing) is to use the [Field Manager](https://github.com/engram-design/FieldManager) plugin, which can export fields as JSON from your staging version, and you can import that JSON using Field Manager again on the live version. You'll still need to manually assign those fields to the associated sections.


---

### Answer by username_2 on 2017-08-16. Score: 1

Another way you could try is to check out [Database & Asset Syncing Between Environments in Craft CMS](https://nystudio107.com/blog/database-asset-syncing-between-environments-in-craft-cms) written by @nystudio107 on the Slack channel. I'm sure he'd be able to help with any sticking points.


---

