Search code examples
redcap

Questions with Regard to Possibility of Backing Up Version of REDCap Survey for Reverting Back To


I am currently in the process of editing a REDCap survey. I was wondering if it was possible to back up the current version of the REDCap survey prior to changes being made in case one wanted to revert to that version in the future?

For example, if the current version of the survey is A, and the survey with changes is called B, would it be possible to back up version A such that one could revert back to version A, even if the new version is B?

Any input regarding this would be much appreciated!


Solution

  • There are a number of ways you can achieve this, but it helps to understand how REDCap's project structure is built.

    First of all, some terminology. REDCap projects contain instruments. Instruments may be enabled as surveys. Survey-enabled instruments can be configured to auto-continue from one to another by various means (auto-continuation in survey settings – with or without logic, survey queue, perhaps others).

    Typically when someone says they have a "REDCap Survey", they mean they have a project where every (or the only) instrument is enabled as a survey, and some methods of backing up apply to instruments only, and some apply to all instruments together, and some to the whole project (which includes other information as described below).

    Next, all of the variables in a project, the instruments they are within, their choice codes, labels, field labels, action tags and everything else that you build in the online designer, is a part of the project's Data Dictionary. The Data Dictionary is stored in a specific database table in REDCap's database, called redcap_metadata.

    Everything else, such as any events and event-instrument mappings (if longitudinal), survey settings, survey queue settings, survey notifications, etc., are not stored in the data dictionary, but elsewhere in REDCap's database tables.

    With that lesson out of the way, here are several ways you can back up your work so you don't lose anything if you make destructive changes.

    1. Clone the entire project. This backs up everything to a new project. If you are on a recent-enough version, this backup project simply contains everything. At the clone step (found in project setup > other functionality > copy project) you can choose to include the data (the records) in the project, or copy the project structure only. This is an excellent method to test changes in the cloned project and if the changes have the right effect in your testing, implement the same changes in your other project.

    2. Create a snapshot of your current instruments. You can do this from the top the online designer, look for the 'create snapshot of instruments' button. This will store the current data dictionary in CSV form in the project, and allow you to roll back later, by exporting the snapshot, and then uploading it on the data dictionary page; a process that effectively wipes all instruments and replaces them with what is uploaded. As the data dictionary does not contain any survey settings, it won't allow you to roll back any changes made anywhere else; it is limited to the fields in the project. As an aside, the data dictionary is very useful for bulk edits to your fields, like globally substituting a pattern in both the field_name column and branching logic simultaneously, or doing things that you currently cannot do in the designer, such as grouping existing radio fields together as a matrix.

    3. Download individual instruments as zip files. You can do this from the 'Choose action' dropdown on each instrument in the online designer. This is like a mini data dictionary for this instrument only, and is useful for sharing instruments with others. Instrument zip files can also be uploaded into the online designer, however, REDCap will ensure uniqueness in its variables, so if there are any field names you have used, the uploaded fields will have a random string appended.

    By far the easiest is to duplicate your project and work on changes there, test them, and then roll them up into your main project. If your main project is in production, then you may be limited in the changes you are able to make. But that's a separate question entirely.