function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Scott0987Scott0987 

backup visualforce code

I am looking for a method to backup the code for a visualforce page and controller.  If it could do it once a day that would be ok.  If it did it on a button click that would be great also.  Is there anything out there that can do that, or is there a way I can write an apex code to do it? 

Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox

You can make it one click by doing the following:

 

1) Install Linux on a server somewhere.

2) Install Java on the server.

3) Install ant on the server.

4) Place the Salesforce Ant toolkit on the server.

5) Install the svn client on the server (most Linux has one available by default).

6) Configure an Ant directory with the required items (build.xml, build.properties, package.xml).

7) Configure the SVN folder to sync with.

8) Write a Shell Script that runs a retrieve metadata, followed by a svn commit.

9) Write a crontab file that runs every night.

 

There. You now have a fully backed up SVN solution.

 

You could also do this other ways, such as a Windows Batch file. You could also store the files as ZIP files instead of on an SVN, but that limits your ability to compare versions.

 

 

All Answers

DaveHDaveH

You should be able to do this with the Force.com Migration Tool. See below.

 

http://wiki.developerforce.com/page/Migration_Tool_Guide

Rahul_sgRahul_sg

you may use Eclipse tool and create a new project eevryday

use ant tool 

use SVN like tortoise svn and sync your eclipse repository to svn

but none of the method is one click.

sfdcfoxsfdcfox

You can make it one click by doing the following:

 

1) Install Linux on a server somewhere.

2) Install Java on the server.

3) Install ant on the server.

4) Place the Salesforce Ant toolkit on the server.

5) Install the svn client on the server (most Linux has one available by default).

6) Configure an Ant directory with the required items (build.xml, build.properties, package.xml).

7) Configure the SVN folder to sync with.

8) Write a Shell Script that runs a retrieve metadata, followed by a svn commit.

9) Write a crontab file that runs every night.

 

There. You now have a fully backed up SVN solution.

 

You could also do this other ways, such as a Windows Batch file. You could also store the files as ZIP files instead of on an SVN, but that limits your ability to compare versions.

 

 

This was selected as the best answer
Chitiz AgarwalChitiz Agarwal
  1. Although this app is not public yet but it will do exactly what you want.

https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000B3XxLEAV

sfdcfoxsfdcfox
Kumar,

I don't know if I can trust my code to an app that promises that I will never "loose" my code. But, it's an interesting app.