Skip to main content

Automates download of the Export Data Weekly Service

Project description

force-backup-automator

What is it?

Do you use the Salesforce Weekly Data Export functionality to take your weekly backups? force-backup-automator is a library to automate the download of backups via the Salesforce Weekly Export Service. This library uses Selenium to login into the Salesforce org and supports lightning or classic modes to download your back ups to your preferred location.

Main Features

Here are a few great things of this package:

  • Uses selenium to login and render the Weekly Export Service page
  • Since it uses selenium to render the page, it supports both Salesforce Lightning or Classic Experience.
  • Can run in headless mode for minimum overhead
  • Uses the Chrome Driver for maximum compatibility
  • Supports other login methods if you prefer to pass your login cookies to the package.

Where to get it

The source code is hosted on Github at: https://github.com/stefanzepeda/force-backup-automator

Binary installers for the latest release version are available at the Python Package Index (PyPI)

pip install force-backup-automator

Dependencies

License

MIT

Documentation

Import the BackupController class as the main helper to download files.

from force-backup-automator import BackupController

Create an instance of the class and provide the Chrome Web Driver location, the link to your org and if you prefer headless mode:

backup_instance = BackupController(driver_location='./chromedriver',org_link='ORG MAIN URL',is_headless=0)

Constructor Parameters

  • driver_location: The path to the Chrome Web Driver, make sure you download the proper version for your Operating System and Chrome binary here
  • org_link: The main url for your Salesforce Org like: https://YOURDOMAIN.my.salesforce.com/
  • login_url: Specify if the driver your login to a sandbox or production. By default production login: https://login.salesforce.com/
  • is_headless: Configures Selenium to run on headless mode.

download_backups

Main method to download back ups

backup_instance.download_backups(download_location='TARGET LOCATION',backup_url='ORG URL/lightning/setup/DataManagementExport/home',user_name='USERNAME',password='PASSWORD')

Parameters

  • download_location: The absolute path to the location where the download files will be saved

  • backup_url: The lightning or classic URL of the Data Export Servive typically for classic: https://YOURDOMAIN.my.salesforce.com/ui/setup/export/DataExportPage/d?setupid=DataManagementExport

  • cookies: Optional parameter if you prefer to handle authentication yourself. Pass the oid and sid cookies to the package in the selenium format as below:

  • user_name: The username to login to the org if cookies are not passed

  • password: The password to login to the org if cookies are not passed

Optimal usage

Combine this package with a Python script and a task scheduler to run this package on a weekly basis. This will give you total control over storage locations and credential vaulting.

Background

I created this package to make my life easier downloading data backups from the Weekly Export Service of Salesforce.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

force_backup_automator-1.4.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

force_backup_automator-1.4-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file force_backup_automator-1.4.tar.gz.

File metadata

  • Download URL: force_backup_automator-1.4.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

File hashes

Hashes for force_backup_automator-1.4.tar.gz
Algorithm Hash digest
SHA256 3bafaee3de7f3f5a619bf5dfb38198eda6d1c24bc0d35a784b21ecb85f415fed
MD5 308fc82e9d7a1cc6c56a4ecb5a70d42a
BLAKE2b-256 9ee651749c984b7a3614e4b2ebc698a9f6eb22ca629dbcaed5c348f7f8acbf61

See more details on using hashes here.

File details

Details for the file force_backup_automator-1.4-py3-none-any.whl.

File metadata

  • Download URL: force_backup_automator-1.4-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

File hashes

Hashes for force_backup_automator-1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bf6b5a2b816ca8ec0ba6a3334bdacf83ea4e545c7577e62c9ee18aac9a39e393
MD5 64e597cdad8810e4e262275a0f18fb91
BLAKE2b-256 b03e1e646c9179d7723c452d26fbe39b4acfaadc084bdfc9dbf253a5a7e3f1e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page