Results 1 to 2 of 2

Thread: Import only non-existing records

  1. #1
    bstonehill is offline Sugar Community Member
    Join Date
    Nov 2006
    Location
    Atlanta, GA
    Posts
    98

    Default Import only non-existing records

    I recently moved Sugar to a new server. I did an upgrade from 4.5.1 to 5.1RC in order to apply the necessary changes to the database structure. I then exported the database as SQL and imported it into a new 5.1RC install. I checked the record count and it appeared that all records were imported successfully. After a few weeks though we started noticing records missing. I still have the original database on the old server. I want to redo the import to hopefully get back any missing records but I don't want to overwrite any of the records that are already in the new database because I don't want to lose any updates or additions that have been made since.

    How can I import that backup without overwriting existing records?
    Sugar Version 5.1.0a
    PHP 5.2.5
    MySQL 5.0.37

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Import only non-existing records

    Perhaps the easiest thing to do would be to import the entire table from the other server onto your new server, but give it a different name (or rename the existing table on the new server that happens to share its name). You should then be able to execute a INSERT INTO..SELECT statement that appends the difference between the two tables into the production table. You could base your comparison on the ID column as it should be unique for each entry.
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 2008-10-13, 05:55 PM
  2. Replies: 7
    Last Post: 2008-04-21, 11:44 PM
  3. Import call records
    By christineeff in forum General Discussion
    Replies: 2
    Last Post: 2007-08-14, 09:17 AM
  4. Import contact on existing account
    By esolarc in forum Developer Help
    Replies: 1
    Last Post: 2006-03-22, 01:21 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •