Working locally then pushing DB changes to live

top_buzz
top_buzz
For your health!Posts: 6,751 edited February 26 in Help Me!
I'm using MAMP to develop my sites/CMS locally then exporting the DB and importing with PHPMyadmin when ready on the live site. That's all working fine but once it's live and the live DB is getting updated how can I then sync that back up with my local DB or work on my local CMS updating the DB etc then update the live DB without overwriting any client edits etc..?

Basically I want some kind of sync feature that won't destroy everything :)

Comments

  • Shiro
    Shiro
    社長 Posts: 15,051
    Databases generally should not be pushed upstream, only downstream. This however can cause issues if the development you are doing is stored in the database. Are you working with WordPress? Do they have some sort of migration tool?
  • jamblo
    jamblo
    Tea Snob Posts: 5,592
    If its WordPress, use this: https://wordpress.org/plugins/all-in-one-wp-migration/

    So much easier than doing the separate parts.
  • top_buzz
    top_buzz
    For your health! Posts: 6,751
    I'm using Craft CMS on this particular job but I was wondering in general really as I was hoping to possibly do it with EE as well. So it sounds like you need to use CMS specific plugins then and not some general MySQL sync tool or something.

    I was just wanting to be able to work on and test new CMS features locally before moving them to live.
  • top_buzz
    top_buzz
    For your health! Posts: 6,751
    This guy suggests using Sequel Pro to sync them up - http://mmckinnon.com/blog/2015/syncing-craft-databases

    Anyone ever tried that? Any risks with it? I don't want to end up destroying my clients updates :)
  • top_buzz
    top_buzz
    For your health! Posts: 6,751
    Looks like this kind of thing may be what I'm looking for too - https://github.com/70kft/craft-golive
  • Shiro
    Shiro
    社長 Posts: 15,051
    top_buzz wrote: »
    This guy suggests using Sequel Pro to sync them up - http://mmckinnon.com/blog/2015/syncing-craft-databases

    Anyone ever tried that? Any risks with it? I don't want to end up destroying my clients updates :)
    I think this is essentially the same as pushing your database from development to live.

    top_buzz wrote: »
    it sounds like you need to use CMS specific plugins then and not some general MySQL sync tool or something.

    That's correct. Each CMS will store it's data in the database in different ways. For example, I believe WordPress stores posts in a single table in a single row, so you could just push the individual rows from dev to prod, but Drupal stores a single post across multiple tables, so the same couldn't be done.

    The other problem with a straight-up database migration of content is that there is no tracking of what has been pushed or not. A CMS specific tool should be able to handle this.
  • freja
    freja
    teacher swedenPosts: 1 edited March 3
    Thanks for the tips Jamblo about the tool "all-in-one-wp-migration". Makes everything alot easier. Cheers!
  • calder12
    calder12
    Senior Member Posts: 13,484
    Shiro wrote: »
    That's correct. Each CMS will store it's data in the database in different ways. For example, I believe WordPress stores posts in a single table in a single row, ...

    Nope, WP stores it's post metadata in a separate table, it's no simpler pushing posts to WP than any other CMS, most of which have shitty database structures.
  • jamblo
    jamblo
    Tea Snob Posts: 5,592
    freja wrote: »
    Thanks for the tips Jamblo about the tool "all-in-one-wp-migration". Makes everything alot easier. Cheers!

    No worries!
Sign In or Register to comment.
© Copyright 2003 - 2016 - DT by Kooc Media