Many of you regularly generate a copy of Salesforce data but not as many keep a copy of metadata. Sometimes Salesforce customers don’t keep a copy of metadata because they don’t know how to do it, other times – because they don’t think it is necessary. Have you ever had to deal with one of the below issues? Or have you ever thought there was a possibility of them happening in your org?
* You are making significant Salesforce changes and you don’t have a sandbox (or cannot keep your sandboxes without a refresh long enough). Something goes wrong and you realize it will take a while to troubleshoot it. Would it not be nice to roll those changes back without having to through all the screens again and undo changes one by one?
* It is a Friday afternoon; just a little bit left until weekend starts and another Salesforce Administrator has just completed some changes. Your users immediately start sending you emails to report the issues. You don’t know what exactly caused this issue yet and need to investigate it. However, it is almost the end of the day and you don’t really want to delay your weekend plans. It would be great if you could quickly undo changes done by the other admin and get back to them on Monday morning.
* Have you ever had to deal with a user who accidently deleted a report some time ago and asked you to urgently restore it as they need it for monthly performance reporting? Or maybe that deleted (or overridden) report broke a dashboard? Now you need to check with the user what exactly they want to see in that report (and not all users can explain such things clearly) and then try and re-create it. Wouldn’t it be good to have that report stored somewhere else?
If the answer to at least one of these questions is yes, it is worth backing up your metadata.
Developers use various tools for backup. These tools are nice to have and in the future posts I’ll review some of them but in reality as an Admin you don’t have to have them to be able to back up your metadata.
All you need to do it to create a Force.com IDE project that includes all metadata, copy this metadata into a dedicated folder on your PC (let’s call it ‘All My Metadata’) and keep regularly refreshing the project and adding new copies into this folder.
- Create a folder called ‘All My Metadata’. This is a parent folder that will contain subfolders with your metadata copies (one subfolder per copy). Every time you do a certain number (type) of changes you need to refresh metadata in your project and copy it into one of ‘All My Metadata’ subfolders.
- To copy metadata from your project into a folder on your PC right-click on a project name and select Force.com -> Project Properties -> Resource. In my case it is ‘C:\Users\Antonina\workspace\My Production Org’
- Copy/remember ‘Location’ and navigate to it on your PC. This is a default location for your Force.com IDE project metadata.
- Copy ‘scr’ folder with all its contents and save it in the first of ‘All My Metadata’ subfolders. You can use today’s date for a subfolder name.
- Go back to the default location of your Force.com IDE project’s metadata (‘C:\Users\Antonina\workspace\My Production Org’).
- Go to ‘src’ folder and delete all its files/subfolders apart from package.xml
- Go back to Force.com IDE.
- Click on the name of your project and click F5 to refresh the view.
By completing the above steps you will delete existing metadata from its default Force.com IDE location on your PC.
- Now you need to refresh your project and get fresh metadata.
- Right-click on Project Name and select Force.com -> Add/Remove Metadata Components.
- Click Add/Remove button.
- Click Refresh sign.
- Click Select All and click OK.
- Click Apply and Yes.
- Once the operation is completed click OK.
Now your project is refreshed. You can go to the default location of your project’s metadata, copy ‘src’ folder and save it into a new subfolder of ‘All My Metadata’ folder.
You can do it once a week or once a month – depending on how often your metadata changes. And if you ever need to look back and do some changes, you will have a simple way of doing it.
Nowadays Salesforce professionals have a number of tools helping increase efficiency and automate certain tasks. However, we need to remember that great power comes with great risks and making backup copies will help you avoid a number of problems.