Results 1 to 9 of 9

Thread: Server Moving Woes

  1. #1
    tanhaa is offline Sugar Community Member
    Join Date
    Jul 2006
    Posts
    38

    Default Server Moving Woes

    I have recently moved sugarcrm from my initial WAMP server to a ubuntu linux server. The reason for the move: Windows was just way too slow, on a linux server, the site has to run faster because of the resources linux takes.

    I was hoping it would be without an issue, but here I am.. going bald in frustration.

    My method was simple:

    1. Move all files via FTP
    2. use phpmyadmin to dump the database from Windows
    3. use phpmyadmin to import the database in Ubuntu

    Everything was going fine. I can even get to the login page of sugarcrm and am able to type the username and password to login but then it all goes down the hill

    This is the error I get:
    Code:
    Warning: require_once(modules/Calls/Call.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/web1/web/sugarcrm/modules/Opportunities/Opportunity.php on line 36
    
    Fatal error: require_once() [function.require]: Failed opening required 'modules/Calls/Call.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/web1/web/sugarcrm/modules/Opportunities/Opportunity.php on line 36
    Now I'm assuming this has to do with paths. I have already chmod(ed) the whole sugarcrm directory to 777. I know, insecure but I really wanted to know what the heck was going on, and was hoping its not cuz something is not being able to write somewhere. Although it seems like somehow, sugar can't find the path to "modules/Calls/Call.php".

    I have checked the php.ini, ensured that safe-mode is off, memory is fine. I even re-ran the install.php file to ensure everything is fine ...

    please help?


    Amit Malhotra

  2. #2
    chrisky is offline Sugar Community Member
    Join Date
    Aug 2006
    Location
    Trondheim, Norway
    Posts
    293

    Cool Re: Server Moving Woes

    I'm impressed! Real impressed with both actions you shared! Damn good job my friend..

    Regarding the ol'lucky 21 (chmod 777) this is one of my personal favorites to eliminate the possibility of file permission errors, though, for the first time yesterday (don't remember what it was at the moment, but it wasn't sugar), Recurisvely chmod'ing a directory didn't work but rather took like 5 or 6 times of running it.. Sub-directories' and their contents were not changed but rather still owned by root.. Ooooohhhh yeah, it was chown that I was using in that particular case, not chmod, but same difference.. Not all the files/dirs got changed until after runnin'er 5 or 6 times, and I haven't an explnation, maybe the server was a bit backlogged and the files were locked..

    Anyways, don't worry about that 777 stunt causing your system to be insecure, as it won't be for long and if you're real paranoid, you could just protect the directory (via .htaccess or web server config). At least chmod/chown,

    In my case, I use chown most the time and it is far safer, though because I chown the files to the user of our webservers you do need root access to the system.
    If you're unfamiliar with the command it is: chown -R webserversUserNameOnLinux.webserversUserNameOnLinu x SugarCRmDirectoryName
    I.e. in my case:
    chown -R apache.apache crm450d

    Back to business, I don't think it's paths, I'm pretty sure of it..
    You said that you got to the login page and that it displayed properly?
    If so, and the screen was displayed as expected (with all content and without errors), then paths are fine, imho.
    It's too time consuming to explain my logic, but simply said, it successfully accessed at least the Login.php file in the Users module not to mention others. If paths were fouled up, then sugar wouldn't have been able to access any modules files.

    What I suggest is from CLI, you take a look at the modules directory and pay attention to the ownership and/or permissoins for each directory, then go into the Calls directory and do the same.. While in the calls directory, you should VERIFY, that the Call.php file is present, and not corrupt as well, thus I'd say to nano it while there..

    If you want to mess around a little...you might also try installing a new/fresh copy of sugar (of the same version, you were trying to restore)..
    First, create a database named something different and unique database name, i.e. crm450d1,
    (I suggest including the version in the name! It makes it alot easier to see/know the sugar version when you get alot of these things, let alone amongst multiple servers)
    Then create a sql user with the same name as your database name, and the users password is your ballgame..
    Assign your new user admin access to that single database only, that is, grant all ..
    .
    Restore your sql database dump to this new database you created.

    Now..
    Start the installation of your new/fresh copy of sugarcrm whereby you go through the setup wizard..
    In the wizard when it asks, you'll enter the database name that you had created, along with the user & pass credentials you created.
    Make sure that you do not enable the dropping (deletion) of the database, nor the creation of example/demo data!

    And let me know how things go and if either of those paths take care of it..
    Hopefully it's just an issue with some files that you might have to replace and/or manually ensure have the correct permissions..

  3. #3
    tanhaa is offline Sugar Community Member
    Join Date
    Jul 2006
    Posts
    38

    Default Re: Server Moving Woes

    Chrisky,

    Thanks a lot for taking the time to brainstorm with me on what the problem could be.

    Anyways, don't worry about that 777 stunt causing your system to be insecure, as it won't be for long and if you're real paranoid, you could just protect the directory (via .htaccess or web server config). At least chmod/chown,
    Yeah.. you are right.. but still. a 777 is a scary number

    In my case, I use chown most the time and it is far safer, though because I chown the files to the user of our webservers you do need root access to the system.
    If you're unfamiliar with the command it is: chown -R webserversUserNameOnLinux.webserversUserNameOnLinu x SugarCRmDirectoryName
    I.e. in my case:
    chown -R apache.apache crm450d
    I forgot to mention, I had already done that, I had changed the owner on the directory to the websuer. It still didn't work. But you know how they say, when you are spending too much time trying to fix a problem, you need to take a break? I think that few hours of sleep I got last night did the trick and I figured out what the problem was.

    At sleeping time last night, I was thinking just like you suggested, do a fresh install, mod it the same way I modded the other one and copy over the modified viewdetail and listdetail files and other modified files and then import the database afresh. I figured it can't be a database problem as whenever I typed the wrong username/pass it would give me a login error means it was connecting fine to the database.

    What I suggest is from CLI, you take a look at the modules directory and pay attention to the ownership and/or permissoins for each directory, then go into the Calls directory and do the same.. While in the calls directory, you should VERIFY, that the Call.php file is present, and not corrupt as well, thus I'd say to nano it while there..
    This is what got me thinking in the morning, I went in the modules directory, checked permissions, ownership and even vi(ed) the Call.php file.... actually.. I vi(ed) the call.php file and that's what hit me! the error!! Windows is not case-sensitive but linux is! While modding the file under windows, i must have renamed it call.php ... so I renamed the file to "Call.php" and voila!! it worked just fine.

    How stupid was that right? Well thanks for your help boss and for everybody else who run into these errors, please check your files are named properly with the proper case!


    Regards

    Amit Malhotra

  4. #4
    tanhaa is offline Sugar Community Member
    Join Date
    Jul 2006
    Posts
    38

    Default Re: Server Moving Woes

    allright

    So one error is fixed. More errors and this time, I really don't know what's going on!!

    on Editing a Scheduled call, I get these two lines:

    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /var/www/web1/web/sugarcrm/include/json_config.php on line 188

    Warning: Invalid argument supplied for foreach() in /var/www/web1/web/sugarcrm/include/json_config.php on line 197
    Any changes made to the scheduled call can't be saved. The error only shows up in Edit view of an existing call. (It doesn't happen when you create a new call). Creating a meeting or editing a meeting doesn't give any errors. Creating a task won't put the focus on the date field (due and start) and won't let me click on the calendar. No other errors show up

    on viewing my calendar I get:

    Warning: Invalid argument supplied for foreach() in /var/www/web1/web/sugarcrm/include/utils/activity_utils.php on line 55
    The problem so far only seems to be happening in the Calendar module and the Activities Module.

    When I tried to make new activities (like new call being scheduled), in the activity listview page, all that showed up was a blank line! No info got saved.

    About my system: Running 4.2.1a on a AMD64 Dual Core, Linux Ubuntu 6.06. The system has been recently moved from Windows XP 32 bit system where it didn't give any such errors. In addition, it has been moved to PHP5 and mysql 5 whereas on the windows system, it was installed using Bitrock Wamp provided by the sugar site which installed a lower version of mysql and PHP.

    Please help! my users will kill me I didn't see these errors before and took the windows server offline... so server is live and someone pointed out the error to me and I have been checking out the php code on those lines, everything seems fine.. could it be a database issue?

    Amit

  5. #5
    tanhaa is offline Sugar Community Member
    Join Date
    Jul 2006
    Posts
    38

    Default Re: Server Moving Woes

    this is the code in these lines:

    json_config.php on line 188
    Code:
     $all_fields = array_merge($all_fields,array('required','        accept_status','name')); // need name field for contacts and users
    json_config.php on line 197
    Code:
    foreach($all_fields as $field) {ll_fields = array_merge(        $all_fields,array('required','        accept_status','name')); // need n        ame field for contacts and users
    activity_utils.php on line 55
    Code:
     foreach($bean->column_fields as $field) {

    Please do help

    Amit

  6. #6
    tanhaa is offline Sugar Community Member
    Join Date
    Jul 2006
    Posts
    38

    Default Re: Server Moving Woes

    Hi all,

    Just upgraded my installation to 4.2.1c. Didn't help with the issues I'm facing.
    ----
    Very reluctant to go to 4.5, I have modified a lot of files in there and am worried what would happen to all the changes
    -----

    incidently, it could be something to do with php.ini settings, maybe something, somewhere.
    any ideas, brainstorming, thoughts.. would really be appreciated.... just a nudge in the right direction?


    Amit

  7. #7
    chrisky is offline Sugar Community Member
    Join Date
    Aug 2006
    Location
    Trondheim, Norway
    Posts
    293

    Cool Re: Server Moving Woes

    Quote Originally Posted by tanhaa
    At sleeping time last night, I was thinking just like you suggested, do a fresh install, mod it the same way I modded the other one and copy over the modified viewdetail and listdetail files and other modified files and then import the database afresh. I figured it can't be a database problem as whenever I typed the wrong username/pass it would give me a login error means it was connecting fine to the database.
    Too much work there my friend... Kdiff!
    If you don't have it installed or worse....not familiar with kdiff, then you must go download & install it!
    (It's even been ported to windows, and works well with Samba). Google it, kdiff3, is what ya want unless there's a newer version.

    Quote Originally Posted by tanhaa
    This is what got me thinking in the morning, I went in the modules directory, checked permissions, ownership and even vi(ed) the Call.php file.... actually.. I vi(ed) the call.php file and that's what hit me! the error!! Windows is not case-sensitive but linux is! While modding the file under windows, i must have renamed it call.php ... so I renamed the file to "Call.php" and voila!! it worked just fine.
    ROFL, yep.. I can see how that one, though simple, can get'cha...
    it's been years since I've experienced that problem (having things setup right will avoid it for the most part), thus it didn't nor ever would have crossed my mind.. But even though, my advice for ya to get in there and really look over that file and everything relating to it...

    Quote Originally Posted by tanhaa
    How stupid was that right? Well thanks for your help boss and for everybody else who run into these errors, please check your files are named properly with the proper case!
    Not stupid, just little mistakes or things we overlook.. We all do it...
    it's only stupid if we're unable to find the cause of it and fix it..

    You're so much wiser than most others out there.. I respect you greatly!

  8. #8
    chrisky is offline Sugar Community Member
    Join Date
    Aug 2006
    Location
    Trondheim, Norway
    Posts
    293

    Cool Re: Server Moving Woes

    Quote Originally Posted by tanhaa
    Hi all,
    Just upgraded my installation to 4.2.1c. Didn't help with the issues I'm facing.
    ----
    Very reluctant to go to 4.5, I have modified a lot of files in there and am worried what would happen to all the changes
    -----
    incidently, it could be something to do with php.ini settings, maybe something, somewhere.
    any ideas, brainstorming, thoughts.. would really be appreciated.... just a nudge in the right direction?
    Amit
    Kdiff is the solution to your modified files issue.. Download and install it, and get to know it, you should be able to effectively use it in 30-60 mins of reading the helpfile and playing with it.

    As for those errors..
    I tell ya exactly what they are (okay, my guess at the least)..

    Lemme ask, though I already know the awnser... Did you have custom fields in your previous sugarcrm windows deployment?

    The errors are related to the custom fields... Yuh boy...hmmmm...
    copy the fields table, the cache files, and the javascript files, and the language files from your previous deployment..

    You'll also need to restore that database dump of yours, and then redump it but without the drop tables command, so that when you go to restore it on top of this new sugarcrm databse, essentially you end up with just all the missing data being added to the database, though be sure that it is set to create [neccessary] tables.

    I don't know off the top of my head, just what 4.2 had for 'repair' functions in which synced the sugarcrm installation to the data and configuration details store in the database, but if the neccessary repair functions are present, then you'll only have to restore your database data, then run applicable 'repair' functions, and you'll be set..

    And tell ya what, since I'm overly impressed, and you definately deserve the help..
    I would be willing to help you first hand opposed to forum posts..
    I'll be out the entire day (and very late) tommorrow, with only a couple hour appointment in the afternoon.
    Drop me an email and we' can get it fixed, together, while walking you through what & how..

    Between kdiff & phpMyAdmin, whatever the problem be, it'll be easily resolved..

    Then you can move onto messing with 450d.. Yesterday, we finally installed 450d as a fresh clean install, and though it hasn't had use by actual users, it appears to look good.. Installation and all went without a hitch, go figure..

    You can just import parts or all of the actual data stored in your sugarcrm 4.2 sql db, and import that into the 450d database, and voila, your data is in 4.5, while both crms are independant of one another, and should one or the other go defunct, etc. Your users can access the other crm installation.. Only bump in the road is if there are data differences between the two databases.. lol, you could have to spend 30 mins (worst case scenario, having to edit the sql dump file to leave remaining on the the data portsions of tables in which we want imported) manually migrating data between the databases, but that's life..

    In english, you can run 4.5 with no risk or consequence..

    Anyways, before we move forward, go get kdiff and get familiar with it!
    That app will be more important that windows or KDE..
    Last edited by chrisky; 2006-10-18 at 08:55 AM.

  9. #9
    tanhaa is offline Sugar Community Member
    Join Date
    Jul 2006
    Posts
    38

    Default Re: Server Moving Woes

    Quote Originally Posted by chrisky
    Too much work there my friend... Kdiff!
    If you don't have it installed or worse....not familiar with kdiff, then you must go download & install it!
    (It's even been ported to windows, and works well with Samba). Google it, kdiff3, is what ya want unless there's a newer version.
    I knew about "diff" utility... but didn't think about it at all when it came to fixing modified files and all. Thanks for the tip Chrisky! it does pay to ask a quesiton in the open-source community where people like you are present...who are so helpful!

    Not stupid, just little mistakes or things we overlook.. We all do it...
    it's only stupid if we're unable to find the cause of it and fix it..

    You're so much wiser than most others out there.. I respect you greatly!
    you are right about that one! But little mistakes like these can cause you hours of trouble-shooting!

    I learnt a long time ago that before asking a question on forums or news-groups, one should always do their homework properly. People repeat the same questions over and over and those who do like to help, get annoyed when someone doesn't search properly before asking the same question. Its only natural, the gurus out there can only be expected to give the same response to several people .. so many times only. So I researched the issue myself before asking the question.

    You know, your brainstorming really helped me a lot. And kdiff helped a lot. Finally, yes, my errors are solved now.

    I did a full reinstall of 4.2.1c, made a brand-new database as well, a completely clean install. To ensure that the database schema is the same, I applied the modules (only a few modules I had) to my new installation. there were only 6 of them, so the modules I added through admin went ok. Now that I know the database schema should be similar (apart for all the custom fields). I dumped my old-installs database and imported just the data in the new database using phpmyadmin. Then i started playing with kdiff... merging differences in the new install file, making sure they were all what I wanted them to be.

    Then... I saw a file in the "calls" module called fields_array.php! It was named "Fields_array.php" and in the new install, there was no such file! So i was like.. umm.. i thought I checked all the cases after I fumbled on "calls.php" ... I guess I had overlooked that one.

    Thanks to kdiff, I found it and I renamed it in the old-install directory. Guess what, all my errors went away!!

    Thanks for brain-storming again, you did nudge me in the right direction. I'm going to keep kdiff if I run into other problems and keep my new-install that I had made as well .. just in case I run into other problems. In the mean time, everything seems to be working fine and dandy.

    In case anybody is wondering about "Speed issues". If you are on windows, take the time to get Linux on, it really helps! The speed of my site has increased a lot. Its simple really, windows uses a lot of resources, Linux doesn't. If you really can't do without a gui on Linux, use XFCE, a light weight gui that comes with xubuntu .. a debian based distro and its a really nice distro.

    Chrisky, thanks for all your help! and thanks for the offer to help me individually as well, it was really really appreciated. kdiff was a great suggestion.

    Regards,

    Amit Malhotra

Thread Information

Users Browsing this Thread

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

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
  •