ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to grab all comments from one database and update a local database with them?

February 11, 2011 11:04am

Subscribe [2]
  • #1 / Feb 11, 2011 11:04am

    clint_f

    70 posts

    Hi there, I need to be able to get all of the comments from my production database and update my local MAMP database with them. Really we’re only talking about a handful of them not 100’s.

    I work locally (on my mac) on new content so I just want to keep my local database as my working database (my local db was an import of production to start with, but have had a couple comments on production since I’ve been working locally) but update the comments before I push my latest entries to production.

    I have a very n00b level of dealing with PHPMyAdmin, I’m usually in there just to do db backups and sometimes dropping tables.

    Help in this would be greatly appreciated if anyone feels inclined. Thanks!

    Using EE 2.1.3

  • #2 / Feb 14, 2011 7:43pm

    Aaron Waldon

    66 posts

    Hi clint_f! This *should* work:

    In your live site’s phpMyAdmin, click on your database name and then click on the “Export” tab. You will want to select all of the tables that have the updated info in them from the multi-select list (hold down control to select multiple tables). These will probably include:
    exp_comments
    exp_comment_subscriptions
    exp_members
    exp_member_data
    exp_member_fields

    Then check the “Save as file” option, and click “Go”. You will be prompted to save the file to your computer.

    Then you will import these tables into your local database (it’s advisable to back it up first):
    Open up your local version of phpMyAdmin, click on the database you want to import into, and then click the “Import” tab. Click on “choose file” and select the file you exported from your live database. Click on “Go” to import your data.

  • #3 / Feb 14, 2011 10:17pm

    clint_f

    70 posts

    Thanks a lot Aaron!  I thought of something though before I dive into this. I’ve added a user locally since my last db pull. If I import exp_members from my prod database will it wipe out the user I added to my local enviro, or is that a separate table?

  • #4 / Feb 15, 2011 1:49pm

    Aaron Waldon

    66 posts

    Yes, you would essentially be overwriting the tables, so your local data would be lost. There may be a way to preserve both. Take a look at the export and import options.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases