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) »
  • Cloning to a local dev environment
Pages: [1]

Author Topic: Cloning to a local dev environment  (Read 991 times)

TeNNoX

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
  • CiviCRM version: v4.4.x
  • CMS version: Drupal v7.x
  • MySQL version: newest
  • PHP version: PHP 5
Cloning to a local dev environment
October 31, 2014, 09:53:03 am
I want to clone the running live system (root server) to a local dev environment (XAMPP installation)

What is the best way to do that?
I already tried several hours... I cloned the complete file structure in /www/sites/ to my computer, and cloned the database tables. Then I set up the same mysql users and changed the civicrm and drupal settings.php.
But there were still many errors which I tried to fix one by one, but it is far from working nicely -.-

I already tried making a fresh install, and then copying the files in www/sites/ to my fresh installation and the database too.
Didn't work as expected either.

Is there a better way?

Dan C

  • I post frequently
  • ***
  • Posts: 179
  • Karma: 17
  • CiviCRM version: All
  • CMS version: Joomla 2.5 and 3.X, Drupal 7, Wordpress 3.7 and up
  • MySQL version: 5.1.7 and up
  • PHP version: 5.3.5 and up
Re: Cloning to a local dev environment
November 01, 2014, 04:25:26 am
You have the right idea, I have a feeling you are just missing some items.  There are places where you need to update file paths, especially if you are going from a Linux to Windows environment (there is a Config.IDS.ini file in the ConfigAndLogs directory and civicrm.config.php file one level further down then the settings file).  You also need to be sure to clear the templates_c directory.

There is a full set of instructions on the Wiki at http://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location for moving to a new server.
CrusonWeb - Web Development, Implementation, and Support.  Specializing in CiviCRM and Joomla (although also knowledgable in Wordpress and Drupal as well).

TeNNoX

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
  • CiviCRM version: v4.4.x
  • CMS version: Drupal v7.x
  • MySQL version: newest
  • PHP version: PHP 5
Re: Cloning to a local dev environment
November 02, 2014, 11:39:21 am
Quote from: Dan C on November 01, 2014, 04:25:26 am
You have the right idea, I have a feeling you are just missing some items.  There are places where you need to update file paths, especially if you are going from a Linux to Windows environment (there is a Config.IDS.ini file in the ConfigAndLogs directory and civicrm.config.php file one level further down then the settings file).  You also need to be sure to clear the templates_c directory.

There is a full set of instructions on the Wiki at http://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location for moving to a new server.

I'm facing multiple problems with too long path names...
Do you have any idea how to fix that?
(e.g. the Drupal 'Backup and Migrate' module can't create long path names...)


TeNNoX

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
  • CiviCRM version: v4.4.x
  • CMS version: Drupal v7.x
  • MySQL version: newest
  • PHP version: PHP 5
Re: Cloning to a local dev environment
November 02, 2014, 03:11:31 pm
Well I can deal with the above problem, but I get errors related to 'tables doesn't exist' when following the instructions from the link and ignoring civicrm_domain and those 4 cache tables...
I then tried to import the tables without data, now the page just shows:
> Sorry but we are not able to provide this at the moment.
> DB Error: no such field

So how the heck can I use the database from the live system in my dev environment?!

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Cloning to a local dev environment
November 03, 2014, 08:31:47 am
FWIW I don't use the backup and migrate module. If I were you, I would do a mysql and copy the files manually.

> Sorry but we are not able to provide this at the moment.
> DB Error: no such field

This sounds like you are missing some columns, or more likely a table.

Quote
ignoring civicrm_domain and those 4 cache tables

This is probably where the problem is - IMO I don't think ignoring those tables is very good advice

Try doing it again without skipping those tables and also note that it says (if copying an existing install don't skip the cache tables they will not be created automatically).

Rather than skipping any tables. I would copy them all and then clear the cache at https://example.org/civicrm/clearcache.

Might be frustrating the first couple of times but you will get the hang of it, I am sure! - Good luck :)
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Cloning to a local dev environment
November 03, 2014, 08:32:50 am
PS - please let us know if you do get it working, and we can work out how to improve those moving instructions.
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Dan C

  • I post frequently
  • ***
  • Posts: 179
  • Karma: 17
  • CiviCRM version: All
  • CMS version: Joomla 2.5 and 3.X, Drupal 7, Wordpress 3.7 and up
  • MySQL version: 5.1.7 and up
  • PHP version: 5.3.5 and up
Re: Cloning to a local dev environment
November 03, 2014, 10:10:30 am
I agree, I don't skip any tables when I do it, and I make my copy directly from the database instead of relying on tools like Backup and Migrate or Akeeba.  I believe the skipping tables suggestion is only if you do a completely clean install of Civi on the dev site, then drop the tables that you are copying from live.  If you are doing that then you don't drop the cache or domain tables from the clean install version and only drop the ones that you took from the live server. 

And make sure if you are taking the backup directly from the database that you disable foreign key checks, those will cause a problem if they are left enabled when you try to import the data.
CrusonWeb - Web Development, Implementation, and Support.  Specializing in CiviCRM and Joomla (although also knowledgable in Wordpress and Drupal as well).

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Cloning to a local dev environment

This forum was archived on 2017-11-26.