vtiger.com - Home of vtiger CRM
  Home Products Downloads Support Buy Support Partners Company  Community Forums Blogs   Extensions
Call Us: +1 408 733 3229

Vtiger CRM - Database Migration Procedure

From vtiger.com

Quick Reference

Contents

Migrating database from version 4.2 to version 4.2 + Patch 2

Warning: Please ensure that you have taken the current vtiger CRM (v4.0) database and source code backup before executing the database migration script.

1. Download the vtiger CRM 4.2 patch from the following URL:

URL:

http://prdownloads.sourceforge.net/vtigercrm/vtiger_CRM_4_2_Patch_2.zip?download

2. Extract the vtiger_CRM_4_2_Patch_2.zip file into your <vtiger CRM Home> directory.

Note: Please don't forget to take the source code backup before extracting the Patch 2, otherwise all your custom code will be overwritten by the new code.

3. Run the http://<Your_Site>/<vtiger_CRM_Home>/vtigerpatch.php from your favorite Web browser.

Note: Please ensure that you have taken the current vtiger CRM database.

4. In your web browser data migration process will be displayed. Once the database migration is completed following messages will be displayed:

Database modified Successfully for vtiger CRM 4.2 Patch 2

config.php file has been updated

Please refer to the following post for more details: http://forums.vtiger.com/viewtopic.php?t=2903



Migrating database from version 4.0.1 to version 4.2

Warning: Please ensure that you have taken the current vtiger CRM (v4.0) database and source code backup before executing the database migration script.

You can migrate the database from vtiger CRM 4.0.1 to vtiger CRM 4.2 as given below:

1. Install vtigerCRM 4.2 GA.

2. Run the install.php and complete the post installation procedure.

3. Now, run the datamigration.shl/bat file present under <vtiger CRM Home> directory and follow the interactive procedure.

4. Once you have completed the procedure, data will be migrated from version 4.0 to version 4.2.

Note: Donot add any data into vtiger CRM before data migration. xx Please refer to the following post if you face any problems: http://forums.vtiger.com/viewtopic.php?t=2589


Migrating database from version 4.0 to version 4.0.1

Warning: Please ensure that you have taken the current vtiger CRM (v4.0) database and source codec backup before executing the database migration script.

You can migrate the database from vtiger CRM 4.0 to vtiger CRM 4.0.1 as given below:

1. Install vtigerCRM 4.0.1 GA.

2. Run the install.php and complete the post installation procedure.

3. Now, run the datamigration.shl/bat file present under <vtiger CRM Home> directory and follow the interactive procedure.

4. Once you have completed the procedure data will be migrated from version 4.0 to version 4.0.1

Note: Donot add any data into vtiger CRM before data migration. xx Please refer to the following post if you face any problems: http://forums.vtiger.com/viewtopic.php?t=1848


Migrating database from version 3.2 to version 4

Warning: Please ensure that you have taken the current vtiger CRM (v3.2) database and source code backup before executing the database migration script.

You can migrate the database from vtiger CRM 3.2 to vtiger CRM 4 as given below:

1. Install vtigerCRM 4 GA.

2. Run the install.php and complete the post installation procedure.

3. Now, run the datamigration.shl/bat file present under <vtiger CRM Home> directory and follow the interactive procedure.

4. Once you have completed the procedure data will be migrated from version 3.2 to version 4.

Note: Do not add any data into vtiger CRM before data migration.

vtiger CRM DB Migration in between two machines

(Revision as of 09:11, 21 May 2006)

Procedure to migrate data from one machine to other machine:

1. Original database dumped to file using command:

 mysqldump  --user=root  --password=  --port=3306  -h  localhost  vtigercrm4_2  >  vtigercrm_dump.txt 

(I created a batch containing this line file for future use! This was placed in the directory C:\Program Files\vtigerCRM4_2\mysql\bin and run.)

2. On a clean installation of vtiger CRM 4.2, install patch 2:

- extract zip file to c:\program files\vtigercrm4_2\apache\htdocs\vtigerCRM

- in browser, run http://localhost/vtigerpatch.php to install the patch.

Before restoring the data onto the clean installation, open the file vtigerCRM4_2.txt in a text editor. At the start of the file, add the line:

 set  FOREIGN_KEY_CHECKS=0; 

At the end of the file, add the line:

 set  FOREIGN_KEY_CHECKS=1; 

Save the file, and place in the directory

 C:\Program  Files\vtigerCRM4_2\mysql\bin 

It is now necessary to 'drop' the old database. From a command prompt in the directory C:\Program Files\vtigerCRM4_2\mysql\bin

type in the line:

 mysql  -u  root  -p 

When prompted for the password, enter the password or press <enter> if none required.

You will now be faced with teh mysql prompt. Drop the database with the command:

 drop  database  vtigercrm4_2; 

Once this is complete, create a new database with the command:

 create  database  vtigercrm4_2; 

Quit the database.

From the directory: C:\Program Files\vtigerCRM4_2\mysql\bin Rune the following command to restore the database:

 mysql  --user=root  --password=  --port=3306  -h  localhost  vtigercrm4_2  --force  <  vtigercrm_dump.txt

Migration Steps

Note:

1. Please remove, 'STRICT_TRANS_TABLES' from the 'SQL MODE'. Otherwise, you may face issues with saving data.
2. Before Migration, In File: modules\Migration\PatchApply.php

   set_time_limit(-1);

change it to

   set_time_limit(0);

To Migrate from 5.x versions

Step 1 : Backup user_priveleges/CustomInvoiceNo.php (if it exists)
Step 2 : Download the patch (vtigercrm-5.0.0-patch4.zip) and unzip it in the vtiger CRM home directory. So that attached zip files will overwrite the existing files.
Step 3 : Restore back the user_priveleges/CustomInvoiceNo.php file and give complete permission to all the users on this file.
Step 4 : Please do the following changes in config.inc.php before starting migration

        Set the value of  $default_charset  as  'UTF-8'.  
        ie.,  $default_charset = 'UTF-8';         
        and add the following lines at the end of the file before ?>.      
        // trim descriptions, titles in listviews to this value
        $listview_max_textlength = 40;

Step 5 : Go to Smarty/templates_c and remove all the cached files which ends with ".tpl.php". If not you may not get the ui changes properly.
Step 6 : Login as admin user. Once you login, you will notice some error on the home page as follows:

Fatal error: Call to a member function FetchRow() on a non-object in ....\include\database\PearDatabase.php on line 424  
        
This is expected behavior as there has been lot of database table changes.  
Ignore this for now and proceed with the next step.

Step 7 : Click on the Settings tab
Step 8 : Go to Migration Wizard.
Step 9 : Use the option 'Upgrade my vtiger 5.x version to Current Version (5.0.4)'
Step 10: Click on Migrate.
Step 11: Once you are done with migration, Go to your browser options and clear the cache.

To Migrate from 4.2.x versions

Step 1  : Take the dump of your database.

         mysqldump <database_name> [ -u username -p ] > dump_file.sql 

Step 2  : Create an empty database

         mysql> create database <new_database>;

Step 3  : Import the data into new database from the dump file.

         mysql> use database <new_database>;
         mysql> source <complete_path>\dump_file.sql

Step 4  : Install vtiger 5.0.4 (during installation give a different database name <dummy_database>)
Step 5  : Login as admin user
Step 6  : Click on the Settings tab
Step 7  : Go to Migration Wizard.
Step 8  : Use the option 'Migration from vtiger 4.2.x (4.2Patch2/4.2.3/4.2.4) to Current Version (5.0.4)'
Step 9  : Select Source -> Select 'I have a new database with 4.2.3 Data'
Step 10 : Give proper database connection parameters and provide the name of the newly created database ( <mew_database>) into which the dump file is imported.
Step 11 : Click on Migrate.
Step 12 : Make a note of all the query failures (if any)
Step 13 : Goto config.inc.php -> Change the database name to <new_database>

         $dbconfig['db_name'] = <new_database>;
Personal tools