Giter VIP home page Giter VIP logo

copper-crm-bkp's Introduction

Copper CRM Backup

Download and backup most of the data from Copper CRM in JSON format.

in hubspot folder, you'll find an at-work toolset to upload Copper CRM data to HubSpot.

Install

npm install

Usage

you need a Copper CRM API KEY / Copper CRM account email pair

COPPER_APIKEY=xxxxxxx [email protected] node index.js

It's possible for multiple reasons (timeouts, over rate limit) that the backup fails or misses items. It is safe to re-run it several times, already fetched items will be skipped. On it's own the script will retry on crashes as long as crashes are occuring less than every 5 seconds;

When everything as been backuped, (do the previous command to check). You might want to remove empty files by running node clean.js. Attention, after this if you restart the backup script all empty entries will be fetched once again.

File download

File download is not possible with Copper Developer API !

The trick is to log-in on Copper and copy your company Id and Cookies. Company Id can be found in the url https://app.copper.com/companies/{YOUR COMPANY ID}/app To get the cookies, it depends on your Browser, on Chrome:

  1. Login Copper
  2. Right click on the page open inspect
  3. Go the network tag
  4. Reload Copper page
  5. In the network tag click on check on the left pane
  6. Go to the Headers tab in Request Headers section and copy the Cookie contents.

It is a quite long string that looks like _fbp=....; logged_in_copper_user=active; pnctest=1; ajs_anonymous_id=...; ajs_user_id=...; ajs_group_id=...; intercom-device-id-t10sa4e7=...; ...

Set the company code as environement variable COPPER_COMPANY and the cookies string as COPPER_COOKIES

run node files.js

extras

cleaning

After running clean scripts, re running the backup will not be able to find empty file and will re-dowload them. Do not use before being sure you have everything.

node clean/cleanFiles.js will remove all data files containing an empty array

node clean/removeEmptyfields.js will remove empty and unsued fields from the backup .. MAKE A BACKUP OF ./data before running!

Notes

This backup is not incremental it first fetches list of the different items then retrieve them one by one. Data is saved in "data/" folder in json format.

An attempt of parallelization has been made with rate-limiting as Copper's API is limiting to 180 calls / minutes. The current logic is pretty weak and could be rewritten using a pool of calls and a fixed number of parrallel call to do.

Files that are links to external ressources such as Google Drive are saved with as data/files/{id}.json items;

Missing

  • It seems nothing ๐Ÿ˜…

copper-crm-bkp's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.