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 »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • having trouble transferring live site to local machine for development
Pages: [1]

Author Topic: having trouble transferring live site to local machine for development  (Read 3512 times)

woodybrando

  • I’m new here
  • *
  • Posts: 27
  • Karma: 1
having trouble transferring live site to local machine for development
June 25, 2009, 02:03:54 am
Hi All,
I'm trying to move my company's website to a local machine but I can't seem to get it right. Our website is running on a lamp server with drupal and civicrm.

1. So I installed lamp and drupal and civicrm on my local machine.
2. I copied over the /etc/apache2/apache2.conf from the remote server to the local one. (the remote server had clean url's enabled and the settings for that were stored in this file. took me a few hours to figure that out.)
2. Exported the drupal and civicrm databases using phpmyadmin.
3. In the local machine's phpmyadmin I created databases of the same names as the live websites databases then imported them. (making sure to add the same mysql user to my local database as the remote one was using)
4. then i followed these directions from Donald Lobo:

Title: Re: easiest way to move to production server?
Post by: Donald Lobo on January 11, 2009, 12:20:54 pm

Is your drupal user table the same between test and production? if not, i'd also do the following:

5. truncate civicrm_uf_match

Once installed you can run synchronize users to contacts or let it happen organically. in addition to the other steps also do:

6. truncate civicrm_menu
7. update civicrm_domain set config_backend = null;
8. truncate sessions table from drupal database

9. Then I edited the local copy of /var/www/sites/default/civicrm.settings.php -

where civicrm_uf_baseurl was set to http://www.company.org/
I replaced
http://www.company.org
with
localhost

10. I secure copied the server directories and  files to my local machine:
/var/www/sites/default/files
/var/www/forum
/var/www/includes
/var/www/themes
/var/www/sites/all/themes
/var/www/sites/default/files/.htaccess

11. restarted apache
apache2ctl restart

12. opened a browser and entered localhost in the address bar.

13. The front page looks good but if I click on a civievent or drupal menu link I get this error:
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'imce_access' was given in /var/www/includes/menu.inc on line 452.

and what's weird is the drupal links show the error and the correct page. But the civievent links just go to an oops page and show the same error?

Does anyone know what step I missed in switching hosts? Or what this error might mean?

also, I just noticed that when I mouse over the civievent link it's trying to reach address /localhost/localhost/civicrm/event looks like i screwed something up and now localhost is doubled up in the link address?

any help would be much appreciated.

thx,
jayson
www.lostvalley.org

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: having trouble transferring live site to local machine for development
June 25, 2009, 01:00:46 pm
Jason - quick google on 'imce_access' clarifies that IMCE is a separate Drupal module. I would disable that module on your localhost (or fix whatever's causing that error) first.

Not sure if the above has anything to do w/ your CiviCRM link problems. I suspect it's more about values in your updated civicrm.settings.php file. I'd re-verify CIVICRM_UF_BASEURL first (and then check others if that doesn't help). Also check for steps in this doc that you might need (esp deleting templates_c dir):

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

On my localhost install, I have:
define( 'CIVICRM_UF_BASEURL'  , 'http://localhost/drupal6/' );
Protect your investment in CiviCRM by  becoming a Member!

woodybrando

  • I’m new here
  • *
  • Posts: 27
  • Karma: 1
Re: having trouble transferring live site to local machine for development
June 26, 2009, 12:42:10 am
Hey Dave thanks for the suggestions. I had tried to follow that walkthrough and got stuck on step five at the time cause my drupal wasn't fully functional yet. But I followed these directions and got that straightened out:

http://drupal.org/upgrade/copying-your-live-site-via-command-line

then I went back to the link you sent me and was able to reset my civicrm baseurl and that fixed everything. Thanks for the help and pointing me back to that link.

This is where I was stuck before cause I couldn't reach this page in case anyone else is having similar problems:

Login to Drupal or to Joomla Administrator and enter the following URL in your browser:

    * Drupal sites: http://<drupal_site>/civicrm/admin/setting/updateConfigBackend?reset=1
    * Joomla sites: http://<joomla_site>/administrator/index2.php?option=com_civicrm&task=civicrm/admin/setting/updateConfigBackend&reset=1




woodybrando

  • I’m new here
  • *
  • Posts: 27
  • Karma: 1
Re: having trouble transferring live site to local machine for development
June 26, 2009, 01:11:05 am
oops, i spoke a little too soon. Just about everything is fixed when I'm logged in as admin, but when i check the site anonymously i still have the same problems.

I'm still getting the redundant link name on the home link it sends me here:

http://192.168.200.3/localhost/

when it should send me to either
http://192.168.0.3 or http://localhost/

is it a problem with my /etc/hosts file?

127.0.0.1            pap.mylivesite.org    localhost.localdomain   localhost
192.168.0.3        pap
192.168.0.204    pip
192.168.0.203    pip
192.168.0.2        sun

And here's an error I'm getting when clicking on http://192.168.200.3/lvecevents which I don't get when clicking on the same link on the live site:

user warning: Table 'lostvalley.civicrm_event' doesn't exist query: SELECT civicrm_event.id AS id, civicrm_event.title AS civicrm_event_title, civicrm_event.start_date AS civicrm_event_start_date FROM civicrm_event civicrm_event LIMIT 0, 10 in /var/www/sites/all/modules/views/includes/view.inc on line 725.

And here's some of my settings from civicrm.settings.php

define( 'CIVICRM_UF'               , 'Drupal'        );

define( 'CIVICRM_UF_DSN'           , 'mysql://livesiteusernam:livesiteuserpasswd@localhost/lostvalley?new_link=true' );

define( 'CIVICRM_DSN'          , 'mysql://livesiteusername:livesiteuserpasswd@localhost/civicrm?new_link=true' );

define( 'CIVICRM_UF_BASEURL'      , '' );

Global $civicrm_root;

$civicrm_root = '/var/www/sites/all/modules/civicrm';
define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/var/www/sites/default/files/civicrm/templates_c/' );

any other settings I should include? I've done all the steps listed in the link Dave posted.
« Last Edit: June 26, 2009, 01:46:52 am by woodybrando »

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: having trouble transferring live site to local machine for development
June 26, 2009, 09:56:25 am
Empty CIVICRM_UF_BASEURL is incorrect. This needs to point to the base URL for your Drupal site (e.g. 'http://localhost/drupal')
Protect your investment in CiviCRM by  becoming a Member!

woodybrando

  • I’m new here
  • *
  • Posts: 27
  • Karma: 1
Re: having trouble transferring live site to local machine for development
June 26, 2009, 03:59:48 pm
Thanks Dave! I just had localhost in there before I emptied it, which was causing the redundant link address. I didn't realize i needed the http:// in front of localhost. Now everything works! thx

edit: actually to have other folks on the local network be able to work on the site as well BASEURL needs to be set to the ip of the localhost so in my case:

define( 'CIVICRM_UF_BASEURL'      , 'http://192.168.0.3/' );
« Last Edit: June 26, 2009, 05:26:17 pm by woodybrando »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • having trouble transferring live site to local machine for development

This forum was archived on 2017-11-26.