Results 1 to 5 of 5

Thread: where can i find my database files

  1. #1
    OneLightCorp is offline Sugar Community Member
    Join Date
    Mar 2008
    Posts
    11

    Default where can i find my database files

    I want to copy old account and contact files into a fresh install of sugar 5.2.0a.

    I copied the entire sugarcrm folder where all the sugar files were stored before the new install, but I need to know if there is a quick and easy way to copy the database files from my old sugar folder into the new one, specifically what I should copy from where, and where should I paste it.

    OS: Windows 2003 Server
    5.2.0a Community Edition (Old version was 5.2.0)
    Apache 2.0
    PHP 5.2.5
    MySQL not sure

    I installed the new system from FastStack so all the components are identical to that package.

    Please help, I feel like this can't be difficult to do but I am not finding anything helpful in the forums thus far.

    Best regards, and thanks in advance.

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

    Default Re: where can i find my database files

    If the new version and the old version are the same, all you really need to do is attach the database to your new MySQL install, then change the config.php file to change the database name setting to the newly attached DB.

    The other thing you'll want to do is copy the <sugar root>/cache/upload folder from the old install to the new, as it contains any documents and attachments you may have been using with your old install.
    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)
    ______________________________________________

  3. #3
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: where can i find my database files

    You need to export the database and import the dumpped data into the new installation:

    mysqldump -u sugar_user --password='sugar_password' sugar_database > sugar_database.sql

    then you can import this way:

    mysql -u sugar_user --password='sugar_password' -D sugar_database < sugar_database.sql

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@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.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  4. #4
    OneLightCorp is offline Sugar Community Member
    Join Date
    Mar 2008
    Posts
    11

    Default Re: where can i find my database files

    I appreciate the prompt responses, but unfortunately you're going to have to be much, much clearer than that.

    I am not experienced at this at all, and though I'm doing my best, I don't really understand a lot of this. I know this is a pain in the butt to explain it in so much detail, but if you could be a little clearer on what you mean when you say things like "attach the database" or what to change in the config.php file. Also for Mr. Lopes, I simply didn't understand what you were telling me to do.

    Explain it like you're explaining it to your grandmother :-)

    Thanks again

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

    Default Re: where can i find my database files

    Quote Originally Posted by OneLightCorp View Post

    Explain it like you're explaining it to your grandmother :-)

    Thanks again
    The only problem with that part of your request is that I'd need to break out the Ouija board because all of my grandparents are dead.

    Moving on....

    This may be something you might consider hiring someone to do it for you, mostly because it would be much more efficient.

    Lets assume that the sugarcrm directory you copied contains your database files (which we haven't established yet), then under the \MySQL\Data folder you should find a folder whose name matches the name of the database you were using for Sugar, i.e. Sugarcrm, sugarcrmdb, etc. Couldn't tell you what it is because you would have defined it at install time. If you can't remember its name, search the sugarcrm folder you copied for a file called "contacts.myd." Whichever folder contains that file is the folder that contains your old database. If you don't get any hits, then you either didn't copy the old database, or it is somewhere else on your computer, at which point I wouldn't know what to tell you, other than to broaden your search.

    Assuming you did find that file and its parent folder, stop your new MySQL server, then use Windows Explorer to copy that database folder to the \MySQL\Data\ folder of the MySQL installation you wish to move it to. Once the copy process finishes, start your new MySQL server. The old database should now be accessible to MySQL.

    Lastly, use Windows Explorer to navigate to the location of your new Sugar installation. In there you will find a file called config.php. Open that file using notepad or other text editor and look for an entry labelled "db_name". The value associated with that entry is the database your new install of Sugar is connecting to. Changing that value to reflect the folder name you copied in the section immediately above will cause it to use the old database that you copied to the new MySQL server. Make the change, save the file and fire up Sugar.
    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: 3
    Last Post: 2009-02-22, 06:53 PM
  2. Find Users email address in the database
    By mylo78 in forum Developer Help
    Replies: 4
    Last Post: 2008-06-27, 03:03 AM
  3. Replies: 3
    Last Post: 2008-03-15, 10:46 AM
  4. Replies: 4
    Last Post: 2007-07-24, 07:56 AM
  5. Replies: 1
    Last Post: 2006-08-06, 03:49 AM

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
  •