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) »
  • Migrating multi-domain to seperate databases?
Pages: [1]

Author Topic: Migrating multi-domain to seperate databases?  (Read 1314 times)

myles

  • I post frequently
  • ***
  • Posts: 263
  • Karma: 11
Migrating multi-domain to seperate databases?
September 20, 2008, 03:43:30 am
Through practising the upgrade I've discovered that domains are no longer supported. This is where one database is used to serve the records of more than one site. This was implemented for reasons that seemed sensible at the time, but there is no real reason now why these separate domains (which are hosted on one Drupal code base) should not use their own databases.

I haven't found any documentation or posts on making the separation, just lots of comments on "we don't know of any implementations out there".

Before I embark on an experimental journey, can anyone suggest a smart way of doing this?

Otherwise I'll keep post any discoveries just in case there are others with domains implemented.

myles

  • I post frequently
  • ***
  • Posts: 263
  • Karma: 11
Re: Migrating multi-domain to seperate databases?
September 20, 2008, 06:50:05 am
I've found two useful, though not quite complete posts that have helped in this - They are scripts for deleting domains and renaming them - though I think they are for older versions, so I've had a little hassle along the way.

Bear in mind that this is not the production version and I have a good set of backups!

I'm using a local installation to do the separation - that is to say for each domain I delete all the domains that I'm not interested in then rename the domain to domain number 1, then dump the database, create a new database appropirately named, populate it using the sql script produced by the dump and then change that sites civicrm settings file to use the new database.

To delete a domain I've used this script:

http://wiki.civicrm.org/confluence/display/CRMDOC/Delete+a+domain

Although it appears to be for an earlier version than 2.0.2 and therefore throws a number of errors - for tables that don't exist I've just skipped.

To pick up the new tables I just tried to delete the domains in civicrm_domain and worked through the constraint errors until I had deleted all the entries in all the tables. I may give a go at noting this more accurately to that I can re-write the script for 2.0.2

Then, because I read somewhere that the upgrade script assumes the domain id to be 1 I used this script to change the domain name:

http://wiki.civicrm.org/confluence/display/CRMDOC/Change+CiviCRM+domain_id

THis seems to be for the same version so has the same extra tables and presumably misses out the same lot. So although I now appear to have a version that upgrades to 2.1 I assume that I have some errors.

Now that I know that it will work, I'll work through the process again and create working scripts for 2.0.2

UNLESS - someone already has versions of these scripts for 2.0.2!!!

That's for later. This is perhaps the only sunny week end in England since spring and I'm craving some sun!

myles

  • I post frequently
  • ***
  • Posts: 263
  • Karma: 11
Re: Migrating multi-domain to seperate databases?
September 22, 2008, 10:49:25 am
These steps were successful for me:

1 Dump the old database or export from phpMyAdmin (as you would to backup)
2 create a new database and user for one particular domain
3 Populate the new database with the data from the old database
4 Delete the unwanted domains (script in another post)
5 Ensure the remaining domain is domain 1 (change it using the script in another post)
6 Change the civicrm settings to use the new database

Job done

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Migrating multi-domain to seperate databases?

This forum was archived on 2017-11-26.