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) »
  • Moving an Existing Drupal Installation to a New Server or Location
Pages: [1]

Author Topic: Moving an Existing Drupal Installation to a New Server or Location  (Read 6433 times)

jyee

  • I’m new here
  • *
  • Posts: 19
  • Karma: 3
Moving an Existing Drupal Installation to a New Server or Location
August 11, 2010, 08:27:35 am
This is an update to the information published here:
http://wiki.civicrm.org/confluence/display/CRMDOC32/Moving+an+Existing+Installation+to+a+New+Server+or+Location
Because that documentation is misleading (or inaccurate)... i realize that the above document is a wiki, so i could probably create an account and just change it, but i decided to post here instead... hopefully to get some feedback and allow someone else to review, then apply changes to the wiki.

1. go to http://<drupal_site>/admin/build/modules and disable, but don't uninstall CiviCRM.  You may need to disable dependent modules (e.g. CiviMember Roles Sync) before you can disable CiviCRM

2. Copy your codebase (Drupal, CiviCRM, files, etc)... all of it.  The documentation suggests that you could install a fresh copy of CiviCRM... I don't like that idea, because it's quite possible for someone to install a different/newer version or one with slightly different files (if e.g. you modified core, which is bad, but some people still do it).  Then you'll be compounding migration issues with upgrade/versioning issues.  Generally with a migration you want to ensure you're copying a site exactly as it is.

3. Copy your databases.  If you're using mysqldump, then you'll actually want to run 3 commands:
Code: [Select]
$ # this is the same as the documentation, full mysqldump of drupal
$ mysqldump -u mysql_username -p drupal_db_name > drupal_dump_file.sql

$ # this is similar to the documentation, but we're not ignoring the civicrm_domain table
$ mysqldump -u mysql_username -p --ignore-table=civicrm_db_name.civicrm_acl_cache \
--ignore-table=civicrm_db_name.civicrm_acl_contact_cache \
--ignore-table=civicrm_db_name.civicrm_cache \
--ignore-table=civicrm_db_name.civicrm_group_contact_cache \
civicrm_db_name > civicrm_dump_file.sql

$ # this is new. drupal/civicrm will generate errors when it discovers the ignored tables \
are missing so you need to append the create table statements (but not the table data) \
to the dump you just created
$ mysqldump -u mysql_username -p --no-data civicrm_db_name civicrm_acl_cache \
civicrm_acl_contact_cache \
civicrm_cache \
civicrm_group_contact_cache >> civicrm_dump_file.sql

4. Load your databases into the new server
Code: [Select]
$ mysql -u mysql_username -p drupal_db_name < drupal_dump_file.sql
$ mysql -u mysql_username -p civicrm_db_name < civicrm_dump_file.sql

5. Delete cache files at <drupal-root>/sites/default/files/civicrm/templates_c/*

6. Log into Drupal http://<drupal_site>/user/login

7. go to http://<drupal_site>/admin/build/modules and enable CiviCRM (but not the other CiviCRM dependent modules)

8. go to http://<drupal_site>/index.php?q=civicrm/admin/setting/updateConfigBackend&reset=1
review the settings there, adjust and click Save

9. go to http://<drupal_site>/index.php?q=civicrm/menu/rebuild&reset=1
to rebuild the menus

10. go to http://<drupal_site>/index.php?q=civicrm/admin/setting/path?reset=1
review your settings, adjust and click Save

11. go to http://<drupal_site>/admin/build/modules and enable any other CiviCRM dependent modules that were disabled in step #1.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Moving an Existing Drupal Installation to a New Server or Location
August 13, 2010, 03:28:14 am
Go ahead and create account on wiki and update the doc.

Thanks
Kurund
Found this reply helpful? Support CiviCRM

cavinbill115

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: 2
  • CMS version: 3.2
  • MySQL version: 5.4
  • PHP version: 5
Re: Moving an Existing Drupal Installation to a New Server or Location
January 17, 2011, 03:07:11 am
Hi,
This site contains very awesome discussion and great sort of informative stuff useful one for many others needs this kind of stuff,..
best regards,..
Cavin
mcse braindumps // Testkings

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Moving an Existing Drupal Installation to a New Server or Location
January 17, 2011, 04:13:41 am
@jyee: Nice to see someone else doing a non-destructive move of CiviCRM. I moved to a different server hosting environment while yet on D5 / Civi 2.0.x and back then the Wiki documents were very helpful for making the move. Within days of us doing said production move, the old Civi 2.0 docs were gone from the Wiki, and the new procedure I recall was to start over with Civi and then restore data from a backup... or something weird like that.

I was just fine with doing the brain surgery of sorts to get Civi to move properly to a different physical path on the new server filesystem. (shrug)

The thing I found was DO NOT EDIT THE DATABASE BACKUP FILE BEFORE RESTORING IT TO THE NEW SERVER.... you MUST edit the DB while it is IN MySQL, NOT externally, due to it being an InnoDB style database. Once I learned that critical detail, the move went quite smoothly.
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

ES.Bill

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 3.4.4
  • CMS version: Drupal 6.20
  • MySQL version: 5.1.54
  • PHP version: 5.2.17
Re: Moving an Existing Drupal Installation to a New Server or Location
April 11, 2011, 08:20:28 am
jyee:  Your instructions saved me a lot of headaches.  I found the original instructions  for migrating that are in the documentation a little confusing and lacking at critical points.  I did things a little differently than you show.  I was moving from a Windows XP macchine with  XAMPP to my linux host.  I ended up editing the civicrm.settings.php file.  In my move I was changing the URL, database name, database user name, database password, and file locations.  I used phpMyAdmin to backup my database and after loading it on my host I used it to Empty the cache files.  Everything came up great.

MastaP

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.x
  • MySQL version: 5.3
  • PHP version: 5.3
Re: Moving an Existing Drupal Installation to a New Server or Location
April 07, 2015, 11:40:29 am
Is there any way of doing this procedure WITHOUT disabling the module on the production site?
Seems rude.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Moving an Existing Drupal Installation to a New Server or Location

This forum was archived on 2017-11-26.