Google Contact Sync 2.1
From Boru Wiki
Boru's Google-vTiger Contact Sync is designed to automatically synchronize your vTiger and Google Contacts. Users can decide which vTiger Contacts are sent to their Google Account and which Google Contacts are added to vTiger. Once a Contact is sent in either direction, all edits to the Contact will be mirrored to the other account.
Contents |
Requirements
- vTiger Version
- vTiger 5.1
- vTiger 5.2.1
- PHP Version 5.2
- Install Zend Library (Provided by Boru)
- Verify SSL is Enabled
- Register Domain
Prepare for Installation
The installation process will modify your vTiger code and database. If you have previously modified your code, installing Google-vTiger Contact Sync may break your code. Boru provides support for modified code for an additional fee. Please contact Boru for more information.
In any case, it is wise to backup your code and database before proceeding.
- Backup your vtiger Contacts
- Backup your Google Contacts
- Backup your database. A mysql backup guide
- Backup your vTiger code. In Linux:
$ tar czvf vtigerBackup.tar.gz /path/to/vtiger
Installation
Zend Library
- Download the latest version here
- Must put Zend libary in vTtiger directory.
/path/to/vtiger/Zend
Installing the Google Contact Sync Module
- Go to menu bar
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-90.png
- Select Settings
- Module Manager
- In the Module Manager
- Select Custom Modules
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MEM-174.png
- Import New
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-92.png
- Browse to the location of where you have the module stored
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-93.png
- Then select Import
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-95.png
- Accept the License agreement
- Click Yes
- Your Module is now installed an can be configured in the Tools Menu
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-94.png
Configure License Keys and ID
- Go to menu bar
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-90.png
- Select Settings
- Module Manager
- In the Module Manager
- Select Custom Modules
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MEM-174.png
- Select Contact Sync Settings (Click on the hammer)
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MEM-177.png
- This is where you will enter in your ID and Key
- ID: Same as User Name from boruapps.com or has been provided by Boru
- Key: Provided by Boru
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MEM-175.png
- Once you have entered in an ID and KEY click on submit
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MEM-176.png
Setup Cron jobs
In order to automatically import changes on the Google side, you must schedule a cron job. The vTiger wiki describes scheduling cron jobs [1]
In Linux
Linux distributions vary, but this is one way:
- Enter the cron file
$ crontab -e
- Add cron/SyncContactFromGA.sh to the file. The example below will update every hour, at 30 minutes past the hour.
30 * * * * root php -f /var/www/vtiger51/modules/ContactSync/syncContactFromGA.php
Verify File Permissions
- File Permissions should be set to 644 for the ContactSync Module
- This will need to be check in your vTiger directory: <vtiger>/modules/ContactSync
- The files inside will also need to have the permissions of 644.
To Set Permissions
sudo chmod -R 644 ContactSync
User Setup
AuthSub
NOTE: If you are on a Hosted Domain (not gmail). Please login to your Google Account before beginning.
Each user can enable and disable Google Contact Sync individually. To enable the Google Contact Sync you must first ask Google to grant vTiger access to your Google Contact list.
- Login to vTiger as usual
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-106.png - Go to "Tools"
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-105.png - Follow the link to obtain a new session token.
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-104.png - Google will take you through a sequence of login screens. These steps vary depending on your current login status with Google. Ensure that you are syncing the correct Google account and grant access.
Note that the URL may display your server's IP address, rather than the domain name.
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-108.png
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-109.png - After granting access, you may have to login to vTiger again.
Now your Google Contact Sync is authorized to connect to your Google Contact list. However, you must configure your settings, before the sync will function.
Settings Page
NOTE: Contact Sync will not work until you save your settings the first time You can only reach the settings when you have a valid session token.
- Go to "Tools"
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-105.png - Follow the link to the settings page.
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-110.png
vTiger to Google Settings
Filters
Any filters you create for contacts can be selected to limit which contacts are sent to Google. The Contact sync will only follow rules set in the Advanced Filters tab.
Filter instructions on the vTiger website.
Destination Group
You should also choose where to create new Contacts. New vTiger Contacts will be stored in this group.
http://prodl01php5.borugroup.com/web2project/user_images/images/MHMILLER/MHMhome-55.png
When finished click "Save" or continue to the Google to vTiger settings section.
Google to vTiger Settings
You can choose the Google Contact groups that will send Contacts to vTiger. You may, for instance, wish to only include Contacts in the Coworkers and vTiger Group, but exclude Contacts from the Family, test, Friends, and My Contacts groups. You would set this configuration up as below.
http://prodl01php5.borugroup.com/web2project/user_images/images/MHMILLER/MHMhome-56.png
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-308.png
Revoking Access Privileges
You can disable the Contact Sync at any time by revoking access privileges to your Google Account.
- Click "Tools"
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-105.png - Follow the link to revoke your session token.
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-111.png
Resetting an Account
If you change the Google account that is linked to a user, you can return to the original account and your old sync status will be restored. Example:
- User A links to Google Account M and sends Contact 1
- User A changes to Google Account P and sends Contact 1
- User A switches back to Google Account M. He cannot resend Contact 1, because it is already up-to-date in Account M.
You can reset the sync status for an account, and all sync state data for that account will be lost. Example
- User A links to Google Account M and sends Contact 1
- User A changes to Google Account P and sends Contact 1
- User A clears sync data for Account M
- User A switches back to Google Account M and sends Contact 1. Now there are two Contact 1s in Account M.
Your First Sync
This is the recommended procedure for syncing the first time. For the most reliable results, your initial contacts should all be located in vTiger.
- Backup your vtiger and Google Contacts.
- Remove all contacts from the Google Contact Group you will send vtiger contacts to.
- Open your Contacts Settings in My Preferences.
- Select a filter for your contacts. Make sure all filter rules are set in the advanced tab.
- Select the Google Contact Group that you will send Contacts to.
- Select the Google Contact Group to import Contacts from.
- Click "Send all to Google"
Manually Syncing
The Contact Sync will automatically send new vTiger Contacts to your Google Account, but you may have to run it manually if you install on a system with existing Contacts. To this, go to "My Preferences" and click the "Send to Google" button.
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-115.png
vTiger will periodically check Google for new and updated contacts. The frequency depends on what you set in your cron tab during installation. To manually retrieve Contacts from Google. Go to "My Preferences and click the "Sync from GA" button.
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-113.png
Troubleshooting
Error 500
This can be caused by incorrect permissions.
Permissions should be 755 for these directories:
- CalendarSync
- ContactSync
- Zend
To change permissions:
chmod -R 644 ContactSync chmod -R 755 Zend
Note: In some cases you may be required to be logged in as root user.
Site Not Registered
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-162.png
AuthSub Target path Prefix
http://prodl01php5.borugroup.com/web2project/user_images/image/MMICHALAK/MM-163.png
- Make sure that you only register www.yourdomain.com. To do so, you go to https://accounts.google.com/ManageDomains and add your domain.
- Do not register www.yourdomain.com/modules/ContactSync/Authsub.php!!!
- If you have already added the domain to the list(prior the google sync installation), and you are getting the error above, please remove the domain and add it again.
Cannot Obtain a Token
- Check SSL to see if it is enabled
- Open file php.ini
- Location in Linux: \apache\bin
- Find ";extension=php_openssl.dll"
- Remove ";" (comment) from that line.
- Save and restart Apache.
- Open file php.ini
Reporting Bugs
To report bugs, please contact mmichalak@boruapps.com
When filing a bug report, the more details the better. What operating system are you using? Is your Google account a Gmail account (i.e. @gmail, @googlemail) or is it a hosted domain? (i.e. @myaddress.com)
Please forward any error messages you receive. Screenshots can also help to diagnose a problem.
