Steps to merge the development version with a production version

mburak - October 15, 2008 - 15:54
Project:Database Scripts
Version:6.x-2.x-dev
Component:Documentation
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Sorry, i'm not understanding the documentation.
What would be the steps to merge the development version with a production version?
Thanks,
Matias.

#1

ceardach - October 15, 2008 - 16:18

This is kinda a high overview:

1) Before you ever split production from development, dump last-merge

Once you're done with development work...

2) Dump development
3) Dump production
4) Do whatever it is you do to have the new dumps in the same working copy (copy the files, use SVN, whichever)
5) If you made any schema changes, you must update both last-merge and production dump files with the updated schema by restoring them, running update.php and importing any content types, then dump them again
6) Run the merge

One of these days I'll write a step by step example of how I manage my websites.

#2

mburak - October 16, 2008 - 13:05

Thank you very much!
I'll try this and wait to you example!

#3

mburak - October 16, 2008 - 19:52

Now the problem is:
-I dump last-merge (just for the first time)
-I do some work on development:
-A block change, which i want to be migrated
-Some content changes (new nodes, delete nodes) which i don't want to be migrated
-Also i do some changes in production content.

-I dump both development and production databases.
-I do the merge.

And I get conflicts.

The behaviour I expect is that the production content remains the same and the new block is migrated to production.

When I get the conflicts there's a message saying:

NOTE: If you want to default all conflicts to production values,

                  run this command instead of resolving manually:

diff3 -e --merge ./databases/tmp/data_dev.sql ./databases/tmp/data_lastmerge.sql ./databases/tmp/data_prod.sql > ./databases/tmp/data_merged.sql

and then i have to run other operations.

I thought that this would keep the production data safe. Am i misunderstanding? Is there a way to accomplish what i need to do?

Thanks.

#4

ceardach - February 22, 2009 - 22:58
Version:5.x-1.0» 6.x-2.x-dev

#5

ceardach - March 2, 2009 - 06:06
Status:active» fixed

I have updated all documentation bundled with the code, and am in the process of updating all the expanded documentation in the drupal books.

The use case you describe though, migrating a single change to production from development, while ignoring other changes made in development, is not a supported workflow. The *merge* completely syncs development and production together in every way so they are clones.

There are workarounds, however. The diffable format and cheap branching will allow you to select certain commits from development to merge with production. The workflow would look something like this:

  • Within development, make commits A, B, C, D, E and F (with a dump for each commit)
  • Dump to dev-original (effectively creating a copy)
  • Remove commits B, D and E using your version control system
  • Merge
  • Restore dev-original
  • Dump to development

Marking this as fixed.

#6

System Message - March 16, 2009 - 06:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

#7

ibagur - June 24, 2009 - 07:46

Hi, I've been trying the merge script with no success. I keep losing the production data.

- Someone adds new content to the production site
- I dump the production database and commit it to the repository
- On the developer site I've been doing some changes (create new views or whatever)
- I dump my development database and also last-merge database (first time as it didn't exist before)
- I svn update my development working copy so I can get the production database with the new content added
- I run the merge script and I get the following result:

"Restoring production database... Done.

Preparing temporary files......................................................................................................................... Done.

Performing merge of data... Successful!

Preparing final files......ERROR 1062 (23000) at line 6099: Duplicate entry '0' for key 1
..ERROR 1062 (23000) at line 6099: Duplicate entry '0' for key 1
.... Done.

Merge completed successfully. Congrats! Pat yourself on the back.
"

- It seems everything when ok apart from an error on duplicate entries, but I guess this is not the problem.
- I restore the new merged production database but I cannot see the new content that was added from production.

What did go wrong?

Thanks

#8

ibagur - June 24, 2009 - 07:46

Hi, I've been trying the merge script with no success. I keep losing the production data.

- Someone adds new content to the production site
- I dump the production database and commit it to the repository
- On the developer site I've been doing some changes (create new views or whatever)
- I dump my development database and also last-merge database (first time as it didn't exist before)
- I svn update my development working copy so I can get the production database with the new content added
- I run the merge script and I get the following results:

Restoring production database... Done.

Preparing temporary files......................................................................................................................... Done. 

Performing merge of data... Successful!

Preparing final files......ERROR 1062 (23000) at line 6099: Duplicate entry '0' for key 1
..ERROR 1062 (23000) at line 6099: Duplicate entry '0' for key 1
.... Done.

Merge completed successfully.  Congrats! Pat yourself on the back.

- It seems everything when ok apart from an error on duplicate entries, but I guess this is not the problem.
- I restore the new merged production database but I cannot see the new content that was added from production.

What did go wrong?

Thanks

 
 

Drupal is a registered trademark of Dries Buytaert.