Obama '08

               
   

Go Back   Mike Simonds > Salesforce > Salesforce PHP Tutorials

This is a discussion on Salesforce PHP Oracle Database Replication Tool within the Salesforce PHP Tutorials forums, part of the Salesforce category; Here is my latest release that will help developers and organizations tremendously.

Reply
 
LinkBack (9) Thread Tools Rate Thread
  #1  
Old 08-06-2007, 03:34 PM
Administrator
 
Join Date: May 2007
Posts: 246
Send a message via AIM to mike Send a message via MSN to mike Send a message via Yahoo to mike Send a message via Skype™ to mike
Lightbulb Salesforce PHP Oracle Database Replication Tool

Here is my latest release that will help developers and organizations tremendously. This new script takes parameters from a web form and will create your Oracle tables/objects via the API. All you have to supply is the following:
  • You're Salesforce Username
  • You're Salesforce Password
  • Table Prefix (e.g. sforce_ ) not required
  • Oracle Database Name
  • Oracle User Name
  • Oracle Password
David Clairborne recently released a tool that will create the schema that a user could copy and paste from a web browser for MySQL and I sent him the Oracle script that performs the same process. This new script will not only create that same file, but it will login to your Oracle database and create the tables for you. This new function ads the ability to create your tables on the fly, without having to try and do it by each individual salesforce object.

This script was developed against a new developers account and it works without any hiccups. It has also been tested against a real live org, a sandbox, and a modified developers account. I do not see why it would not work against anyone's or any company's live instance.

If you plan on using this script to test it out, there are a few lines of code that need to be checked so they match your paths of the following scripts from the PHP toolkit:

Check line numbers 19 and 20 and make sure you correct the paths to the following:

PHP Code:
require_once ('./includes/soapclient/SforcePartnerClient.php');
require_once (
'./includes/soapclient/SforceHeaderOptions.php'); 
Check line number 37 and make sure you correct the path to the following:

PHP Code:
$wsdl './includes/soapclient/partner.wsdl.xml'
If you forget to modify these lines, the script will fail. This takes into account that the table names and field names in Oracle cannot exceed 30 characters, so you will need to check your table names once the script is complete. An example of this is the Oracle reserved word, Number. There are field names which are in salesforce that have this same exact name. Here is what I did to check this and change the name to Number__c:


PHP Code:
$field->name substr($field->name030);
if (
$field->name == "Number")
{
       
$field->name "Number__c";
}
else
{
      
$field->name $field->name;

If you wish to obtain the SQL file that is also created to this, it will be located in the same folder as this script runs in and is called:

Code:
salesforce_oracle.sql
If you wish to only have the SQL file generated then uncomment the exit() statement on line number 99.

This script uses ADOdb to connect to Oracle; you MUST be using this database class in order for this script to work, if you do not, THE SCRIPT WILL FAIL.

You can download the ADOdb package from the main menu on my home page. This package was developed to work with:

Apache
Oracle 10g
PHP 5.*

If you have any questions please feel free to use the contact form on this site and I will do my best to get back to you ASAP!

I am working on improving this system with enhancements that will even perform the database replication with a nice UI that users will be able to actually pick the tables and fields that they wish to backup. I am also going to release this same script for MySQL in the next couple of days


Thanks,
Mike
Attached Files
File Type: zip salesforce_oracle_build.zip (3.2 KB, 64 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2  
Old 08-09-2007, 10:27 AM
Administrator
 
Join Date: May 2007
Posts: 246
Send a message via AIM to mike Send a message via MSN to mike Send a message via Yahoo to mike Send a message via Skype™ to mike

Updated the Oracle database replication tool, Minor changes and Oracle Connection check at start of script

~Mike
Attached Files
File Type: zip salesforce_oracle_build_101.zip (3.3 KB, 68 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 09-18-2007, 11:19 PM
Unregistered
Guest
 
Posts: n/a
Pull Data From SF.com, but what about Push into?

I am looking to do some automated importation of data and was curious if you have found a way to do this with PHP?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 09-19-2007, 08:52 AM
Administrator
 
Join Date: May 2007
Posts: 246
Send a message via AIM to mike Send a message via MSN to mike Send a message via Yahoo to mike Send a message via Skype™ to mike

Quote:
Originally Posted by Unregistered View Post
I am looking to do some automated importation of data and was curious if you have found a way to do this with PHP?
When you say some sort of automated process, do you mean like replicate your data from salesforce to a local database (like oracle)?

If that is what you mean, yes I have created scripts which can run on cron (automated) and download an entire object and its data into a local database. I have done this for both Oracle and MySQL

Can you be more specific on what you are trying to accomplish. Also a name would be nice to know
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

LinkBacks (?)
LinkBack to this Thread: http://www.mikesimonds.com/salesforce-php-oracle-database-replication-tool-t45.html
Posted By For Type Date
Michael Simonds Success Story - developer.force.com This thread Refback 06-18-2008 08:55 AM
Community - Complete Salesforce PHP Oracle Database Replication Tool - Perl, PHP, Python & Ruby Development - Salesforce.com Community This thread Refback 02-01-2008 03:51 AM
Community - Complete Salesforce PHP Oracle Database Replication Tool - Perl, PHP, Python & Ruby Development - Salesforce.com Community This thread Refback 12-20-2007 02:34 AM
Perspectives on Salesforce.com » The Community This thread Refback 09-20-2007 10:51 AM
Perspectives on Salesforce.com » API This thread Refback 08-25-2007 10:53 PM
Community - Complete Salesforce PHP Oracle Database Replication Tool - Perl, PHP, Python & Ruby Development - Salesforce.com Community This thread Refback 08-23-2007 07:30 PM
Perspectives on Salesforce.com » Replicate Salesforce Schema to Oracle or MySQL This thread Pingback 08-10-2007 12:57 AM
API - ApexDevNet This thread Refback 08-06-2007 03:45 PM
Community - Complete Salesforce PHP Oracle Database Replication Tool - Perl, PHP, Python & Ruby Development - Salesforce.com Community This thread Refback 08-06-2007 03:43 PM



Powered by vBulletin


SEO by vBSEO 3.2.0 RC8 ©2008, Crawlability, Inc.

1 2 3 4 5