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) »
  • Migration trouble
Pages: [1]

Author Topic: Migration trouble  (Read 1022 times)

karunadave

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 0
    • Karuna Dev
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 6.30 or Drupal 7.26 Drush 6.2.0
  • MySQL version: 5.5.35-cll - MySQL Community Server (GPL)
  • PHP version: 5.3.21
Migration trouble
September 22, 2010, 09:38:57 pm
Hello CiviCRM forum.

I am having a bit of trouble with a server migration.

I have Drupal 6.19 and CiviCRM 3.1.6 on both servers.

I have the Drupal up and installed a new CiviCRM and verified it's working - one way to make sure the civicrm.settings.php file is good.  

$civicrm_root = '/home/userdir2/public_html/sites/all/modules/civicrm';
define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/home/userdir2/public_html/sites/site2.com/files/civicrm/templates_c/' );

define( 'CIVICRM_UF_BASEURL'      , 'http://www.site2.com/' );

The Drupal settings.php
$base_url = 'http://www.site2.com';

Although I haven't done this to start, now I have also tried replacing old config information with new in the migrating database (the slight difference in path <drpl6> is intended):

Changed
/home/userdir1/public_html/drpl6/sites/site1.org/
to
/home/userdir2/public_html/sites/site2.com/


Changed
http://www.site1.org/sites/all/modules/civicrm/
to
http://site2.com/sites/all/modules/civicrm/

I drop all tables in the CiviCRM database and restore the actual migrating CiviCRM database.

What happens pasted in just below.  One result is that when I edit settings like Localization, the settings load with odd defaults like default currency = AED and no default country, changing these fields and saving and reopening Localization shows that changes are not saved - back to AED for currency.  The new test CiviCRM I do first does work correctly.

Please, any suggestions?

Code: [Select]

    * warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/userdir2/public_html/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php on line 170.
    * warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/userdir2/public_html/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php on line 170.
    * warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/userdir2/public_html/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php on line 170.
    <ED. TRUNCATED>
    * warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/userdir2/public_html/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php on line 130.
    * warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/userdir2/public_html/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php on line 130.
    * warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/userdir2/public_html/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php on line 130.
    <ED. TRUNCATED>
    * warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/userdir2/public_html/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php on line 134.
    * warning: Invalid argument supplied for foreach() in /home/userdir2/public_html/sites/all/modules/civicrm/CRM/Core/Config.php on line 404.
    * warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/userdir2/public_html/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php on line 170.
    * warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/userdir2/public_html/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php on line 170.
    * warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/userdir2/public_html/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php on line 170.
    <ED. TRUNCATED>
    * warning: Invalid argument supplied for foreach() in /home/userdir2/public_html/sites/all/modules/civicrm/CRM/Core/Config/Defaults.php on line 236.

If afterwards I delete the en_US folder under templates_c I receive the following error.

Code: [Select]
Fatal error: Uncaught exception 'Exception' with message 'Please make sure the folder is writable' in /home/site2/public_html/sites/all/modules/civicrm/packages/IDS/Monitor.php:218 Stack trace: #0 /home/site2/public_html/sites/all/modules/civicrm/CRM/Core/IDS.php(142): IDS_Monitor->__construct(Array, Object(IDS_Init)) #1 /home/site2/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_IDS->check(Array) #2 /home/site2/public_html/sites/all/modules/civicrm/drupal/civicrm.module(349): CRM_Core_Invoke::invoke(Array) #3 /home/site2/public_html/includes/menu.inc(348): civicrm_invoke('admin', 'setting', 'localization') #4 /home/site2/public_html/index.php(18): menu_execute_active_handler() #5 {main} thrown in /home/site2/public_html/sites/all/modules/civicrm/packages/IDS/Monitor.php on line 218
« Last Edit: September 22, 2010, 09:43:32 pm by karunadave »

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Migration trouble
September 22, 2010, 10:56:40 pm
Have you reviewed the steps / trouble-shooting info here:
http://wiki.civicrm.org/confluence/display/CRMDOC32/Moving+an+Existing+Installation+to+a+New+Server+or+Location
Protect your investment in CiviCRM by  becoming a Member!

damion

  • I’m new here
  • *
  • Posts: 16
  • Karma: 1
Re: Migration trouble
October 07, 2010, 03:39:26 am
After running into the above error, it took me a few hours of poking around to come to this so to save others time:  Its possible to duplicate a drupal + civicrm install (in my case to create a beta and live website) without too much pain on the same server in a different website with slightly different file path.  In my case I had the civicrm database loaded into same database as drupal cms, but the following shouldn't change even if they are separate.

First, to mention installation path changes lead to certain civicrm file path settings to fail.  These appear to be all stored in the civicrm_domain table config_backend field as a coded string datastructure.  One can change them carefully, and the above errors go away.  The errors occur primarily because in /civicrm/Core/BAO/Settings.php (~line 184 in v 3.2), php can't unserialize the config_backend field because of syntax errors - It ends up with no fields in an array that is supposed to be populated.  (if config_backend is correct and spits out file path variables which don't match current setup, perhaps other errors stem from that; I haven't explored that realm).

Some steps below require phpMyAdmin or similar:

1) Copy desired civicrm database to new mySQL db
2) set civicrm.settings.php appropriately.
3) edit the civicrm_domain table config_backend field.  You want to change the same fields that are listed here on your existing install:

/civicrm/admin/domain&action=update&reset=1

config_backend strings to check file paths on:

uploadDir
imageUploadDir
customFileUploadDir
customTemplateDir
customPHPPathDir
configAndLogDir

And maybe a few others (just not in my case).  The trick is that you have to adjust the string length to match the change you've made to the file paths.  e.g. if uploadDir is 5 characters longer, then

s:9:"uploadDir";s:79:"/var/www/vhosts/..."

becomes

s:9:"uploadDir";s:84:"/var/www/vhosts/...longr"

4) clear out the sites/default/files/civicrm/templates_c/ folder (wherever it is for your current install)

I found I was able to browse my new drupal/civicrm installation after that.

A question for the civicrm designers: did you make some of these file paths absolute for security reasons?  Otherwise I would advocate making them all relative to the website root folder, so none of this hacking is necessary.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Migration trouble

This forum was archived on 2017-11-26.