Van Wilson

Merge changes in dev site with production blog

Vote 0 Votes

I have a client who using MT 4.37 for their site, several related blog and one more-or-less static "blog" for a series of tutorials.

On their development server, I have added a breadcrumb trail to a client's tutorial blog, along with new category pages for when people click on the breadcrumbs. They spent several days customizing the excerpts for each "lesson" extry and adding category descriptions, all of which are now used on those breadcrumb-to-category pages. (There are almost 300 lessons.) I thought the best way to move this to their production server would be to Backup this blog on dev, and Restore during off-peak time on production.

Now, I have found out that they have been making minor edits over the past year to these lessons, but only on production, edits which they don't want to lose. I could easily push and refresh the Template Set (we have one) for the changes to the layout, but I don't know how to merge the customized excerpts and category descriptions on dev, with the revised entry text on production.

Is there any import/export magic, even if it involved meld or some other merge tool as an intermediate step, that would save having to re-enter all these excerpts and descriptions?

(Both servers are running linux, and we have command-line access, as well as access to the MT admin interface.)

Reported on Movable Type 4.3

3 Replies

| Add a Reply
  • Hi Van,

    You may like to backup both databases and then to extract data from the mt_entry table like entry_id and entry_excerpt.

    Use those details to construct mysql update commands for all the 300 lines.

    The same concept could be used also for the category descriptions.

    Kind Regards,
    Mihai Bocsaru

    ----------------------------------
    Daily Movable Type Consultant

    Web Development
    Movable Type Consulting
    Six Apart Partner

    http://www.pro-it-service.com/
    ----------------------------------

    Movable Type Demo
    http://www.movabletypedemo.org/
    ----------------------------------

    Open Melody Demo
    http://www.openmelodydemo.org/

  • @Mihai Bocsaru,

    Thanks for the suggestion. Your idea worked great.

    I didn't have to do a full backup, just a:
    SELECT entry_excerpt,entry_basename FROM mt_entry WHERE entry_blog_id=44 INTO OUTFILE '/tmp/excerpts.sql' FIELDS TERMINATED BY ',' ENCLOSED BY "'" LINES TERMINATED BY '\n';

    then I used some vim search-and-replace commands to change the raw CSV data into appropriate UPDATE statements.

    (I couldn't use the entry_id field because when the original table was pushed to production, the entries were created with different IDs.)

  • You're welcome!

    You could definitely backup only the table that you are going to change, but I've suggested a full backup just in case you won't be very technical to understand the difference in between creating a backup for a specific table or a full one ;)

    Glad to hear you've got it working.

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1774 6167

Last Topic: Template modules by Zielun on Feb 16, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1434 5088

Last Topic: Maintenance announcement by Nick on Feb 17, 2012

695 2912

Last Topic: Insert Image / File Fails by Russ Miller on Feb 10, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

174 740

Last Topic: Captcha images rendering slowly by ScottM on Feb 12, 2012

190 568

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 720

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012