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) »
  • Moving a production site to a local site: getting Civicrm error
Pages: [1]

Author Topic: Moving a production site to a local site: getting Civicrm error  (Read 2801 times)

shrill

  • Guest
Moving a production site to a local site: getting Civicrm error
September 16, 2009, 11:19:56 am
Hi.

I have a production site which works fine on Bluehost. I'm trying to make a copy on my local Windows machine so that I can do some pretty urgent development work. I'm working with Civicrm 2.0 and Drupal 5.18.

Code: [Select]

    * warning: include_once(CRM/Core/Config.php) [function.include-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\sites\all\modules\civicrm\drupal\civicrm.module on line 249.
    * warning: include_once() [function.include]: Failed opening 'CRM/Core/Config.php' for inclusion (include_path='.;/var/www/htdocs/sites/all/modules/civicrm;/var/www/htdocs/sites/all/modules/civicrm\packages;.;C:\xampp\php\pear\') in C:\xampp\htdocs\sites\all\modules\civicrm\drupal\civicrm.module on line 249.

Oops! - The path for including CiviCRM code files is not set properly. Most likely there is an error in the civicrm_root setting in your CiviCRM settings file (sites/default/civicrm.settings.php).

» civicrm_root is currently set to: /var/www/htdocs/sites/all/modules/civicrm.

I have tried numerous settings in the civicrm settings file which changes the path listed above but not a lot else. I've tried everything I've been able to find here but it is possible I've missed something. I'm not a programmer so if you could suggest a path to try, that would be wonderful (or any other ideas you have).

Install (in Vista) is in C:\xampp\htdocs\sites\all\modules\civicrm (drupal site is in the root of htdocs).

Thanks so much for any help you can provide.

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: Moving a production site to a local site: getting Civicrm error
September 16, 2009, 11:42:17 am

check and follow the steps detailed here:

http://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location

note that the above document was written with more recent versions

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

shrill

  • Guest
Re: Moving a production site to a local site: getting Civicrm error
September 16, 2009, 07:35:50 pm
Thanks so much.

For the civicrm_root value: what happens on a local install? Should I be including the C:\ or should I be starting in the xampp directory or something else?


Shrill

shrill

  • Guest
Re: Moving a production site to a local site: getting Civicrm error
September 17, 2009, 06:33:00 pm
Okay. So here's where I'm at.

I managed to find reference to paths on Xampp and it appears to be C:/xampp...... so I've changed my path to reflect that.

So now I have:
Code: [Select]
$civicrm_root = 'C:/xampp/htdocs/sites/all/modules/civicrm';
define( 'CIVICRM_TEMPLATE_COMPILEDIR', 'C:/xampp/htdocs/files/civicrm/templates_c/' );

and:
Code: [Select]
define( 'CIVICRM_UF_BASEURL'      , 'http://localhost' );
And the error messages disappear.

However, now I get the white screen of death:

Code: [Select]
Sorry. A non-recoverable error has occurred. The error trace below might help to resolve the issue

Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -24
    [message] => DB Error: connect failed
    [mode] => 16
    [debug_info] =>  [DB Error: connect failed]
    [type] => DB_Error
    [user_info] =>  [DB Error: connect failed]
    [to_string] => [db_error: message="DB Error: connect failed" code=-24 mode=callback callback=CRM_Core_Error::handle prefix="" info=" [DB Error: connect failed]"]
)



I assume that is because of the following from http://wiki.civicrm.org/confluence/display/CRMUPCOMING/Moving+an+Existing+Installation+to+a+New+Server+or+Location.


I've made Config_Backend NULL. So now I need to simulate the old directory setup.
Quote
After entering the "updateConfigBackend" URL you may get an error suggesting you need to set the Config_Backend column to NULL. Please execute the following sql in your database (using mysql shell or PHPMyAdmin)

update civicrm_domain set config_backend = null;

You may also not receive this error message at all, but rather simply a white screen and a Segmentation Fault in the Apache logs.

One cause of this is when your servers have different paths to the top-level directory (eg, if your old server has a path of '/home/USER/public_html' and the new one has a path of '/var/www/SITE'). If this is the case, simulate the old server's directory structure on your new server. For example, on a Linux server ...

# Create a link for the old server's root. You might need to create parent directories.

mkdir PARENT-DIRECTORIES-OF-OLD-SERVER-ROOT     # if needed
ls -s NEW-SERVER-ROOT OLD-SERVER-ROOT

# For example ...
#
# mkdir /home/USER
# ln -s /var/www/SITE /home/USER/public_html

The link enables all 'old server' references to work, until they can be replaced with 'new server' references (ie, Resource URLs and Directories under Global Settings). Then it can be removed.

Alternatively, you can change the paths directly in the civiCRM database: the config_backend field in the civicrm_domain table contains this configuration information.
Labels parameters


How do I do that in windows with Xampp?

Thanks again.

Shrill

[/code]

shrill

  • Guest
Re: Moving a production site to a local site: getting Civicrm error
September 18, 2009, 07:51:40 pm
Okay continued problems. I've adjusted the civicrm.settings file with new paths as follows:

Code: [Select]
global $civicrm_root;

$civicrm_root = 'C:/xampp/htdocs/sites/all/modules/civicrm/drupal/';
define( 'CIVICRM_TEMPLATE_COMPILEDIR', 'C:/xampp/htdocs/files/civicrm/templates_c/' );

Now the white screen is gone and I'm back to the error messages:
Code: [Select]

    * warning: include_once(CRM/Core/Config.php) [function.include-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\sites\all\modules\civicrm\drupal\civicrm.module on line 249.
    * warning: include_once() [function.include]: Failed opening 'CRM/Core/Config.php' for inclusion (include_path='.;C:/xampp/htdocs/sites/all/modules/civicrm/drupal/;C:/xampp/htdocs/sites/all/modules/civicrm/drupal/\packages;.;C:\xampp\php\pear\') in C:\xampp\htdocs\sites\all\modules\civicrm\drupal\civicrm.module on line 249.

Oops! - The path for including CiviCRM code files is not set properly. Most likely there is an error in the civicrm_root setting in your CiviCRM settings file (sites/default/civicrm.settings.php).

» civicrm_root is currently set to: C:/xampp/htdocs/sites/all/modules/civicrm/drupal/.

I notice from this message that it has the CRM/Core/Config.php file as the issue. That file is located at: C:/xampp/htdocs/sites/all/modules/civicrm/CRM/Core/Config.php
Isn't Civicrm finding that file?

I can confirm that the module file is in C:/xampp/htdocs/sites/all/modules/civicrm/drupal



Again, any help that any one can provide would be greatly appreciated. I'm far from being a programmer and this is well beyond my knowledge. I've tried to follow the user guide but keep running into things that don't work: eg. when I try to navigate to http://localhost/civicrm/admin/setting/updateConfigBackend?reset=1 I get a Page not found error (both with and without Clean URLs turned on, and my Civicrm menu isn't there so I can't seem to try anything else either.

So I guess I'm back to paths? But I've tried literally dozens of combinations as well as various types of slashes ( and I really can't figure this out.

Thanks again for your help. As I've said this is a pretty urgent problem.

Shrill

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: Moving a production site to a local site: getting Civicrm error
September 19, 2009, 07:24:46 am

sorry, we dont run or use windows, so our windows knowledge is minimal / non-existent :(

You might want to try fixing your civicrm_root to be:

C:\xampp\htdocs\sites\all\modules\civicrm

rather than what it is currently (whihc i think uses the forward slash)

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

shrill

  • Guest
Re: Moving a production site to a local site: getting Civicrm error
September 19, 2009, 09:21:36 am
Thanks Lobo. I'll give that a shot. If it doesn't work, I'm going to try installing a fresh copy of Civicrm and importing my data. I'll report back.

Just a quick question re: the environment that you work on. I'm assuming it is Linux. I'm on a new computer now, with tons of hard drive space so once this urgent development is done, I'm considering partitioning the hard drive and installing a Linux for development of Drupal/ Civicrm etc. sites (with most other stuff staying on the Windows partition). Is there any particular version of Linux that you would recommend? Would it be easier to install a Server edition or to just install a LAMP afterwards? Keeping in mind that I've only had fairly limited exposure to Linux and am not the programming type (more of a website creative person).

Thanks,

Shrill

shrill

  • Guest
Re: Moving a production site to a local site: getting Civicrm error
September 19, 2009, 10:03:02 am
Hello again.

So the suggestion that Lobo made still didn't work and I installed a fresh copy of Civicrm which is working fine (haven't imported my data yet).

Thought I would put what the path settings are now (as chosen by Civicrm 2.07) so that those searching for the same problem will be able to try them out. This is for a standard Xampp installation in C: with my drupal 5 site in the root directory (so right in htdocs as opposed to htdocs/drupal or similar). It is the compiledir that is completely different, with slashes going both ways.

$civicrm_root = 'C:/xampp/htdocs/sites/all/modules/civicrm';
define( 'CIVICRM_TEMPLATE_COMPILEDIR', 'C:/xampp/htdocs\\files\\civicrm\\templates_c\\' );

Also it appears that there may have been some database user permission issues as Civicrm didn't want to install. I deleted the user and reset them using the following statement in the SQL window of Phpmyadmin which I found here: http://drupal.org/node/75545

Code: [Select]
GRANT ALL PRIVILEGES ON drupal.* TO 'drupaluser'@'localhost' IDENTIFIED BY 'drupalpassword' WITH GRANT OPTION; FLUSH PRIVILEGES;
I hope this is helpful to someone!

Shrill

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: Moving a production site to a local site: getting Civicrm error
September 19, 2009, 10:15:40 am

we use a mixture of MacOSX and ubuntu. for your desktop, you should install the desktop edition of ubuntu

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Moving a production site to a local site: getting Civicrm error

This forum was archived on 2017-11-26.