CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • When Changing Servers/ Databases in Drupal (Problems with IDS)
Pages: [1]

Author Topic: When Changing Servers/ Databases in Drupal (Problems with IDS)  (Read 6604 times)

mojowen

  • Guest
When Changing Servers/ Databases in Drupal (Problems with IDS)
March 10, 2009, 06:19:46 pm
Alright, I've been scouring these boards for an answer and, failing to get one, I just stumbled around till I fixed my problem.

I'm documenting what I did here because I hate CiviCRM and I want to spare anyone the pain my org and I went through.  We're dumping this mother as soon as possible (I'll post an alternative, maybe :P) but till them I'm stuck with you bastards and might as well contribute.

Our web site was recently migrated to a new server and everyf**kingthing broke.  First I got an error like this guy http://forum.civicrm.org/index.php/topic,4832.0.html and then shit didn't even load.  I ended up reinstalling civicrm (by reinstalling I mean running the 'installer' on http://yourmomssite.com/sites/all/modules/civicrm/install/index.php).  But this wipes out your MYSQL databases, so obviously its not an option if you're moving to a preexisting databases.  Here's what I'd do now, now that I know what happened.

I will site where I got the ideas, maybe.  Its been a mad hunt through the bowels of the internet to find anything about this damnable info.

Migrating Servers

First, make sure your civicrm.settings.php file is up to date.  It uses an absolute address for both the civicrm directory and the civicrm temp directory.  Don't assume you're at the same absolute place on the new server.  http://wiki.civicrm.org/confluence/display/CRMDOC21/Moving+an+Existing+Installation+to+a+New+Server+or+Location

Second, clear those mutherf**king temp files (templates_c/* and config.ids).  Do it by hand, in sftp or ftp.  You can also do it from inside of Civi, I'll talk about it in a sec. Also from http://wiki.civicrm.org/confluence/display/CRMDOC21/Moving+an+Existing+Installation+to+a+New+Server+or+Location.  Also make sure all of these are writable by the server:
/sites/default/files
/sites/default/files/civicrm/uploads
/sites/default/files/civicrm/templates_c

Third, and this is not mentioned in the previous links, CHECK YOUR MYSQL.  That's right ladies, in your database there's a table (civicrm_domain) and in that table, there's civicrm_backend.  Make sure this mother is set to NULL. This cost me hours.  Fix that shit.  http://www.opensourcery.com/blog/jonathan-hedstrom/civicrm-deployment-host-host

After fixing that shit, reset CiviCRM using the admin tools.  I found the following resets helpful (the 2nd isn't really that necessary probably):

Will reset some of the functions - http://yourmomswebsite.com/civicrm/menu/rebuild?reset=1
Will rebuild the menu - http://yourmomswebsite.com/civicrm/menu/rebuild?reset=1
Will dump the BOTH temp directories - http://yourmomswebsite.com/civicrm/admin&directoryCleanup=3

Now, and this is a relevant question, what if CiviCRM isn't loading?  Now this was a problem for me.  I started out by looking at my server errors and seeing what was making noise, this led me to comment out lines 186-190 in /civicrm/packages/IDS/monitor.php and some lines from  /civicrm/packages/IDS/filters/storage.php.  This made civiCRM load but it was ugly as hell.

Turns out if CiviCRM isn't loading due to IDS, just comment out line 74 of civicrm/CRM/Core/Invoke.php.
From http://forum.civicrm.org/index.php/topic,6147.0.html.  This will tone the bad boy down so you can run these rebuild thingers and modify:

http://yourmomswebsite.com/civicrm/admin/setting/path?reset=1
http://yourmomswebsite.com/civicrm/admin/setting/updateConfigBackend?reset=1

Still not working?  Well hell, I don't know. Good luck.

Migrating Databases

Changing databases is a bit easier.  Your main hitch is going to be making sure the new database has the correct information in the civirm_domain table (I'm assuming changing civicrm.settings.php to POINT to the new database is pretty self explanatory).  If it gives you problems, make sure you set that mother to NULL and do all the fancy resets from inside of CiviCRM (if there's a way to trigger that rebuild without having to go to CiviCRM on the web site, that'd be awesome to hear).

Tone

I realize its been completely unhelpful and unprofessional.  I'm just trying to be in sync with CiviCRM in general (and not you guys you're great  [especially that lobo guy, you rock!], I just hate the program and the cheap developer, i.e. www.hermanconsult.com/, who put it on our web site).
« Last Edit: March 11, 2009, 09:57:14 am by mojowen »

Shadow

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 1
Re: When Changing Servers/ Databases in Drupal (Problems with IDS)
March 11, 2009, 10:44:52 am
AAARRRGH!   You may be right on with this one!   I just did this yesterday and while checking my data after rebuilding the tables, I noticed some of my data was missing..............not names, but addresses, cities and such.  I now need to rebuild my data.  Luckily I backed up at the end of each step of this update to 2.1!    I just hope that my data wasn't corrupted along the way.   This upgrade is one big pain!!!!!!! :o  It is like the upgrade that won't go away!  TEN DAYS now that I have been working on this and each time, something else pops up..............and the site admin isn't happy!

Most of your steps I had already done.............others (like the domain table fix) I did not do at the time but will try them.  I did use that install url and can only figure that was what wiped out my data, since you noted that it deletes stuff, which I did not know when I was trying to figure out why, as in my case, the install routines would not run. And of course, executed it multiple times. Thanks for your post!

Shadow
« Last Edit: March 11, 2009, 11:29:50 am by Shadow »

excell@drupal.org

  • Guest
Re: When Changing Servers/ Databases in Drupal (Problems with IDS)
May 04, 2009, 01:02:56 pm
Thanks very much for taking the time to put all that together.

I was trying to set up a backup copy of the website and was getting the IDS error message and deleted files/civicrm/upload/Config.IDS.ini and cleared the cache from files directory etc.

It still didn't work, until I changed the civicrm_domain >config_backend to NULL - then everything was good! - thanks to this post.
 ;D

Adding - Not trying to minimise the pain seen above, but I cleaned up the message for my own notes..so here is a copy in case it helps anybody else:

CiviCRM - Migrating Servers

Before commencing back up and store your database!

First, make sure your civicrm.settings.php file is up to date.  It uses an absolute address for both the civicrm directory and the civicrm temp directory.  Don't assume you're at the same absolute place on the new server.  http://wiki.civicrm.org/confluence/display/CRMDOC21/Moving+an+Existing+Installation+to+a+New+Server+or+Location

Second, clear the temp files:
/sites/default/files/civicrm/uploads > delete Config.IDS.ini
/sites/default/files/civicrm/templates_c > delete all

Make sure all of these are writable by the server:
/sites/default/files
/sites/default/files/civicrm/uploads
/sites/default/files/civicrm/templates_c

Third, CHECK MYSQL.  In the database table (civicrm_domain) set the civicrm_backend to NULL.  Reference: http://www.opensourcery.com/blog/jonathan-hedstrom/civicrm-deployment-host-host

After that reset and check that everything is configured correctly in CiviCRM using the admin tools.
Rebuild the menu - http://yourdomain.com/civicrm/menu/rebuild?reset=1
http://yourdomain.com/civicrm/admin/setting/path?reset=1
http://yourdomain.com/civicrm/admin/setting/updateConfigBackend?reset=1
Clear temp directories - http://yourdomain.com/civicrm/admin&directoryCleanup=3

(If CiviCRM isn't loading due to IDS, temporarily comment out line 74 of civicrm/CRM/Core/Invoke.php.)

« Last Edit: May 04, 2009, 01:46:41 pm by excell@drupal.org »

Fairtlough

  • Guest
Re: When Changing Servers/ Databases in Drupal (Problems with IDS)
May 16, 2009, 08:58:46 am
I'm bloody glad I found this without too much looking around: I've only spent a day ??? trying to move drupal/civicrm from my test server to a subdomain on the very same server.  Came up against all those problems to do with IDS (is it a coincidence that this code has the same initials as an ex-leader of the British Conservative party who was not particularly successful?).

I had problems migrating my drupal installation (initially getting a blank page with no error messages to indicate what was wrong) and after I thought to turn civicrm off before migrating I discovered that the problems are all down to civicrm.  Whole of drupal broken by these temporary files and database caches.

It seems that civicrm's temporary directories now need to be writable by the whole world??  I tried restricting write permission to user or user+group and that broke it again.  Does anyone have a fix for that?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: When Changing Servers/ Databases in Drupal (Problems with IDS)
May 16, 2009, 01:55:04 pm
Quote from: Fairtlough on May 16, 2009, 08:58:46 am
It seems that civicrm's temporary directories now need to be writable by the whole world??  I tried restricting write permission to user or user+group and that broke it again.  Does anyone have a fix for that?

like any other web application, civicrm's temporary directories need to be writable by the web server. Ensure that your group/owner of files / directories is valid (and preferably the web server for those places where it needs to be writable)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Fairtlough

  • Guest
Re: When Changing Servers/ Databases in Drupal (Problems with IDS)
May 21, 2009, 03:23:25 am
thanks lobo for the tip; the group id must be wrong.  I guess I now rtfm.

bmodesign

  • I’m new here
  • *
  • Posts: 16
  • Karma: 2
Re: When Changing Servers/ Databases in Drupal (Problems with IDS)
May 29, 2009, 09:45:29 pm
Wish I would've found this sooner, I'm not sure if I did what was right, but I need to put it on here if someone has the same trouble.

I was running into a ton of errors with civicrm after transferring to another hosting provider. Drupal was fine, but CiviCRM was giving a blank white screen when trying to view civi pages. I was getting Smarty errors, and config file errors, etc. while looking at account settings and admin pages of my site as well. (any page that connected to civicrm for some reason)

The thing that stopped all errors, and gave me access to CiviCRM, instead of an annoying White Screen, was deleting the civicrm folder in my files directory. I saved it to my computer before hand, in case I need something from there at some point. But, after deleting it, I had full access to CiviCRM! with no annoying errors.

Hope this helps some people.
bmodesign

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: When Changing Servers/ Databases in Drupal (Problems with IDS)
May 29, 2009, 11:10:28 pm
Before you suggest it I can't offer to do this - but maybe a move.php page that at checks all the various settings required in a move & displays them might be really helpful.

I think the joomla install process has something a bit like that.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: When Changing Servers/ Databases in Drupal (Problems with IDS)
May 30, 2009, 07:42:11 am

there is a menu item called UpdateConfigBackend.php which does what you say. However if your civicrm install is hosed, you cannot access that menu item. The alternative would be to write something as a drupal module / joomla component / standalone php file to help fix things if hosed

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Margal

  • Guest
Re: When Changing Servers/ Databases in Drupal (Problems with IDS)
December 22, 2009, 03:54:14 am
Menu rebuild on Drupal

If you have problems with the published link to clear the menu cache: Drupal sites: _http://<drupal_site>/civicrm/menu/rebuild?reset=1

Try this: _http://localhost/index.php?q=civicrm/menu/rebuild&reset=1
"&" instead of "?"  - don't know why that made all the difference I'm using a Mac OS 10.5.8

see this for more info: http://forum.civicrm.org/index.php/topic,11005.0.html
« Last Edit: December 22, 2009, 05:19:42 am by Margal »

mhm

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 2
Re: When Changing Servers/ Databases in Drupal (Problems with IDS)
September 10, 2012, 03:28:28 pm
I know it's been a long time, but I just wanted to thank bmodesign at reply #6 for posting that - solved my problem completely! Thanks!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • When Changing Servers/ Databases in Drupal (Problems with IDS)

This forum was archived on 2017-11-26.