Results 1 to 8 of 8

Thread: Is it possible to recover a deleted account?

  1. #1
    m0thr4 is offline Senior Member
    Join Date
    Jul 2008
    Posts
    21

    Default Is it possible to recover a deleted account?

    Please excuse my ignorance here, I don't use Sugar at all, but I do provide support for the Unix/MySQL platform it runs on.

    My boss has just informed me that he accidentally deleted an account, and if I can possibly restore it.

    I saw another post saying that nothing is deleted in Sugar, it's just marked as deleted in the database. I have located this account in the database and can see that the deleted flag is set to '1'; however, I don't want to change just that if it's going to mess up the integrity of any other dependants.

    Is this the right way forward, i.e. to fix it in the database, or will it end up being too complicated? Is there another, safer way to restore a deleted account and everything related to it?

  2. #2
    dlorenzetti's Avatar
    dlorenzetti is offline Sugar Community Member
    Join Date
    Jan 2008
    Location
    São Paulo, Brasil
    Posts
    189

    Default Re: Is it possible to recover a deleted account?

    No, you need to mark deleted as 0 and mark deleted 0 in the relationships talbes too.
    Diego Lorenzetti
    Lampada Global Services - Open Source Solutions
    Phone: +55 11 3237-3110
    Email: equipe@lampadaglobal.com
    Site: www.lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

  3. #3
    m0thr4 is offline Senior Member
    Join Date
    Jul 2008
    Posts
    21

    Default Re: Is it possible to recover a deleted account?

    Quote Originally Posted by dlorenzetti View Post
    No, you need to mark deleted as 0 and mark deleted 0 in the relationships talbes too.
    Wow, thanks for the quick response. And that (above) should sort it all out completely?

  4. #4
    dlorenzetti's Avatar
    dlorenzetti is offline Sugar Community Member
    Join Date
    Jan 2008
    Location
    São Paulo, Brasil
    Posts
    189

    Default Re: Is it possible to recover a deleted account?

    Sorry I'm not sure if I did understand your question, but if I did: Yes, if you mark as 0 in database and mark in the relationship tables too, this account and the relationships going to appears again in the system.
    Diego Lorenzetti
    Lampada Global Services - Open Source Solutions
    Phone: +55 11 3237-3110
    Email: equipe@lampadaglobal.com
    Site: www.lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

  5. #5
    m0thr4 is offline Senior Member
    Join Date
    Jul 2008
    Posts
    21

    Default Re: Is it possible to recover a deleted account?

    Quote Originally Posted by dlorenzetti View Post
    Sorry I'm not sure if I did understand your question, but if I did: Yes, if you mark as 0 in database and mark in the relationship tables too, this account and the relationships going to appears again in the system.
    When you say, 'the relationship tables', which actual tables are you referring to? There is a table called 'relationships' but that looks like one that defines relationships for the software and also it doesn't have anything in it that's marked as deleted.

    If I just mark the account back to not being deleted, I can see it in SugarCRM, however, all of the leads, contacts, history etc. are empty. I guess what I need is a list of all the tables I need to look at, if that's not too much trouble.

    Thanks.

  6. #6
    dlorenzetti's Avatar
    dlorenzetti is offline Sugar Community Member
    Join Date
    Jan 2008
    Location
    São Paulo, Brasil
    Posts
    189

    Default Re: Is it possible to recover a deleted account?

    Exactly, the leads, historys, etc are empty because you don't mark 0 in relationship tables, for each relationship there is a table, for Contacts in Accounts is accounts_contacts, there you can find the row with account_id = your account id and mark the deleted field in that row as 0, the same for, accounts_calls, accounts_meetings, etc.
    Diego Lorenzetti
    Lampada Global Services - Open Source Solutions
    Phone: +55 11 3237-3110
    Email: equipe@lampadaglobal.com
    Site: www.lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

  7. #7
    m0thr4 is offline Senior Member
    Join Date
    Jul 2008
    Posts
    21

    Default Re: Is it possible to recover a deleted account?

    Quote Originally Posted by dlorenzetti View Post
    Exactly, the leads, historys, etc are empty because you don't mark 0 in relationship tables, for each relationship there is a table, for Contacts in Accounts is accounts_contacts, there you can find the row with account_id = your account id and mark the deleted field in that row as 0, the same for, accounts_calls, accounts_meetings, etc.
    Ok, I think I'm on the right track here. I've found that not all of the related tables are prefixed with 'accounts_' by running:

    Code:
    select * from relationships where lhs_table = 'accounts';
    Now going through each one that is linked on account_id and repairing the damage.

    Thanks for your help!

  8. #8
    dlorenzetti's Avatar
    dlorenzetti is offline Sugar Community Member
    Join Date
    Jan 2008
    Location
    São Paulo, Brasil
    Posts
    189

    Default Re: Is it possible to recover a deleted account?

    Nice, good idea.

    Cheers
    Diego Lorenzetti
    Lampada Global Services - Open Source Solutions
    Phone: +55 11 3237-3110
    Email: equipe@lampadaglobal.com
    Site: www.lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to recover the deleted data?
    By ramji123 in forum Developer Help
    Replies: 3
    Last Post: 2008-10-10, 10:03 AM
  2. URGENT: Recover deleted campaigns
    By srinivasreddy in forum Help
    Replies: 6
    Last Post: 2008-06-26, 05:41 PM
  3. Replies: 1
    Last Post: 2008-04-17, 01:22 PM
  4. I deleted my Account list Column setup
    By baydreamer in forum Help
    Replies: 2
    Last Post: 2006-08-17, 07:52 PM
  5. Replies: 2
    Last Post: 2005-10-25, 11:18 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
  •