Skip to main content

Metadata Backup

Backup is a very importan t aspect of software lifecyle that allows you to recover from loses or understand/troubleshoot issues. Most of the engineering teams always treats source repository as a source of truth, while aspiring, it is not possible to adhere to that in Salesforce process because of changes that team does in UI not related to code like access changes or custom label changes etc.,

Metasync Backup is feature rich solution for continuous backup of your one or more Salesforce orgs (sandbox or production) with ability to group commits by User and time of change and high-frequency backup (upto few minutes) for critical Metadata Types (typically code changes in sandbox environments).

Noteworthy Features

  • Ability to sync from Salesforce org to any git branch
  • Tracks metadata changes from earlier backup to current state and sync only incremental changes
  • While committing changes to Git, groups commits by User so you will always know user/time of change
  • Schedule the Metadata Backups

Screens and Layouts

Jobs List Page

To view list of Jobs, click on the Jobs main menu item.

backup-list-page.png

Job Page

To view Job details, click on the Job name link in the Jobs List page

Details Tab

This tab shows the Job field details

backup-job-details.png

History Tab

This tab shows the Job execution history

backup-job-history.png

Run Page

To view Job Run details, click on the Run Id link in the Job History page

Details Tab

This tab shows the Run field details

backup-run-details.png

Components Tab

This tab shows all the components that were backuped during this backup run and their different type.

backup-run-components.png

Warnings Tab

Some times there may be errors or warnings during the backup process. This could be due to an issue with component or backup process. All such warnings are listed in this tab.

backup-run-warnings.png

Managing Jobs

List Jobs

To view list of Jobs, click on the Jobs main menu item. System will show list of Jobs available to you. You can do following things in the List page

  • Add new Job by clicking the + icon
  • Edit a Job by clicking on Pencil Icon
  • Delete Jobs by selecting one or more Jobs and clicking on Trash Can icon
  • Filter list to show the Jobs of your interest
  • Search with in Grid by entering search keyword
  • Navigate to Job details by clicking on Job link

Creating Job

info

You need to create Sfdc Connection, Git Connection, Sfdc Org and Git Repo before you could add a Metadata Backup Job

  • Click on Jobs Metasync Menu
  • Click on + icon in the Data Grid to create new Job
  • Select Metadata Backup as Job type
  • Select Sfdc Org and Git Repo as applicable and enter the Branch Name
  • Enter any applicable Inclusions/Exclusions in one or more Backup Items
  • Click Save to create Job. System would create a Job and takes you to newly created Job.

Editing Job

  • Click on Pencil Icon next to a Job or Click on the More Actions menu from Job page and click Edit
  • Edit the details and click Save

Executing Job

To execute the Job, got the Job page and click on the Play (>) icon next to Job name. System will prompt you to confirm the execution and upon confirmation it will submit the Job for execution.

View Run Details

Job History Tab shows the list of Runs for this Job and their status. Click on the Run Id link on the Run you would like to see the details of. That should show you Run Page. This page shows all details related to that Run.

If the Run backed up any components, those components would be listed in the Run Components page and View Changes would point to the Git backup commit.

Scheduling Job

When you create the Job, Schedule frequency is set to Manual so it will run when you execute manually. If you would like to schedule, Edit the Job and set the Scheduling > Frequency as anything other than Manual. System will execute the Job as per the defined interval.

Reference

Job Fields

FieldTypeDefaultDescription
NameText (100)Name of the Job
TypePicklistType of the Job. Once created, Type cannot be changed. To create different type of Job, deleted and re-create the Job.
StatusPicklistActiveStatus of the Job. If you set it as Inactive, Job will not be executed.
Scheduling
FrequencyPicklistManualFrequency at this which this job must be executed. Defaults to Manual in which case, Job runs only when somebody executes it manually.
Cron PatternString(Shown when Frequency=Cron) Specifies the Cron pattern by this this Job must be run. To section Scheduling for more info.
Schedulig TimeZoneTime zone that be used to determine time of day during scheduling.
Start AtDate TimeAbsolute time when Job execution should begin
Stop AtDate TimeAbsolute time when Job execution should stop
Properties
Sfdc OrgReferenceSfdc Org which to be backed up
Git RepoReferenceGit Repo to backup the metadata to
BranchText (100)Git branch to backup the Metadata to
Backup ItemsListSee Backup Items for more info

Job Options Fields

Job options can be specified by clicking on Options button in the Job Dialog. Following fields details the fields in that dialog.

FieldTypeDefaultDescription
Metadata Backup
Group Commits ByPicklistUserWhen backup job creates commits, it can group the commits by user who made those changes. If this is None, then Metasync creates single commits for all changes backed up
Read ThreadsNumberNumber of threads to use read the metadata list or metadata content
Full Backup DaysNumber30See Full Backup Days for more info
Execution
Log LevelPicklistInfoControls the amount of information logged during job execution
NotificationsSee Notifications for more info

Backup Items

Backup Item allows you to filter subset of Metadata Types (and Metadata Components) that needs to be backup. It also allows to specify differing backup frequency such that you can have some metadata types backed up less frequently than Job frequency interval. Backup items is optional and if nothing is specified, then it will backup all components each time it runs

Backup Item Fields

backup-item.png

FieldTypeDefaultDescription
Include MetadataMetadata PatternComma or new line separated list of Metadata Pattern items
Exclude MetadataMetadata Pattern
Frequency MinsNumberInterval in number of minutes when this Backup Item needs to be backed up
  • Metadata Pattern item is specified in format MetadataType/MetadataComponent. For ex., ApexClass/* or ApexClass/AccountHandler
  • MetadataComponent supports wildcards
  • If MetadataComponent part is not specified, then it is matches all components of that type. For ex., ApexClass
  • If Frequenty Mins is blank, then it is considered each time when Job runs
  • For a metadata component to be considered matched, then it must be included in the Include Metadata and not excluded in `Exclude Metadata

Examples

  • This configuration backups all component types each time it runs except Profile. And Profiles are backed up once a day.

    Include MetadataExclude MetadataFrequency Mins
    Profile1440
    *Profile
  • This configuration backups Code each time Job runs, Profiles every day and then rest of the metadata every 8 hours

    Include MetadataExclude MetadataFrequency Mins
    Code
    Profile1440
    *Code,Profile480

Full Backup Days

Metasync when it runs for the first time, it fetches Metadata from the Org. In subsequent Runs, it fetches the content for components which are added/modified/deleted and backups those changes. Full Backup Days indicates how often, Metasync must perform full backup instead of incremental. Defaults to 30 days.