This is a tool to generate a SQL schema to match a Salesforce Org Schema.
Salesforce2Sql will connect to a Salesforce org, allow you to select a collection of objects, and have the schema for those objects replicated to a local database. This can be very useful when working on data migration and archiving projects.
No data is replicated just the schema.
If you are looking for help migrating data between Salesforce Orgs you may want check out the Salesforce Open Source Commons Data Generation Toolkit Project.
Read the full Getting Started guide.
There is also a getting started guide on SpinningCode.org with a bit more commentary.
You can either download the latest release for your operating system or run from code.
To make this tool useful you will also need a Salesforce org you want to mirror, and a MySQL, Mariadb, or Postgres database you can create tables in.
To run the project from code you will need a working copy of NodeJS 22 or later.
- Clone this repo (or create your own fork) to your local machine.
- Run:
npm installfrom the project root directory, and wait for all the packages to load (this takes a few minutes). - Run:
npm start
Currently Salesforce2Sql supports MySQL, MariaDB, and Postgres. Other databases supported by KNEX.JS can be added upon request.
This project has no direct association with Salesforce except the use of the APIs provided under the terms of use of their services.
If you would like to contribute to this project please feel invited to do so. Feel free to review open issues and read the contributing guide.
