Use the Code Saver app to automatically back up your Hubs' Custom Code blocks, and to quickly restore from your backups at any time.
Before you begin
- To use Code Saver, your Uberflip account must have API access. This feature is included with certain pack types, or may be added on to your Uberflip subscription. For more information, please speak with your Uberflip account representative.
- To follow the instructions in this article, you must be a member of the Account Administrators user group in the Uberflip account where you are using Code Saver.
- After installing the Code Saver Marketplace app, you can also add the Code Saver > View Code Saver App permission to any user or user group to allow them to access Code Saver.
About Code Saver
Code Saver is a utility for backing up and restoring Custom Code in your Uberflip Hubs. With Code Saver, you can:
- Automatically back up the code in Custom Code blocks from your Hubs to a secure GitHub repository every 24 hours
- Browse all individual Code Block backups, view the code that was backed up, and restore any backup of your choice to your Hub with just a few clicks
Code Saver is designed to help you recover from situations where you have accidentally broken your Hub's Custom Code, such as if you unintentionally delete a Custom Code block, or make changes that render the code non-functional. If this happens, you can use Code Saver to restore an earlier, working version of the affected Custom Code block to bring your Hub back to full functionality.
Install Code Saver
To use Code Saver, you must first install the Code Saver Marketplace app.
- Log in to your Uberflip account at app.uberflip.com.
- Go to the Code Saver listing page in Uberflip Marketplace.
- Click on Install.
- If the app has been successfully installed, you'll see Code Saver listed under Marketplace > Installed Apps in Uberflip:
- In addition, you'll also see a new Code Saver menu option in the sidebar menu in Uberflip:
Open Code Saver
To set up Code Saver to back up your Custom Code, and to restore it, open up the app from within Uberflip.
- Log in to your Uberflip account at app.uberflip.com.
- Click on Code Saver in the sidebar menu:
- You will be logged in to Code Saver automatically, and the Code Saver app interface will appear on the right.
Code Saver accesses your account using your Uberflip API credentials. If you have not yet generated API credentials for your user account, Code Saver will automatically generate these for you the first time you open the app.
Enable and manage Custom Code backups
Code Saver can back up Custom Code blocks within any Hubs connected to your Uberflip account. You can choose to turn on or pause backups for each of your Hubs individually.
Use Code Saver's Backup section to manage your Custom Code backups. This section is always displayed by default whenever you open Code Saver, and shows the current backup status of all Hubs within your account:
View backup status
Each Hub in your account is represented by its own tile in the Backup section, which displays its current backup status:
- Hub details: Indicates the name of the Hub (click to open the Hub), and the current number of Custom Code blocks in the Hub
- Backup status: Displays current backup status as Enabled or Paused.
- Last backup timestamp: Indicates the time and date when the last backup for this Hub was made
Enable Custom Code backups for a Hub
By default, backups for all Hubs are disabled (paused) when you first install Code Saver. To enable backups for a Hub, click on the toggle switch in the Hub's tile:
- You must enable backups for each Hub separately. Only Custom Code blocks located in Hubs where backup has been enabled will be backed up.
- Enabling backups for a Hub will create a vault for that Hub, a secure GitHub repository dedicated to backups for that Hub only.
- When you enable backups for a Hub in your account, Code Saver will begin automatically backing up all Custom Code blocks within that Hub once a day, at 11:45 PM Eastern Time. You can see a countdown to the next backup to the right of the Hub backup status tiles:
- If this is the first time you've enabled backups for a Hub, Code Saver will make a backup immediately.
- If there are any previous backups for a Hub, Code Saver will make a backup at the next backup cycle (11:45 PM ET).
What gets backed up?
Code Saver will back up (and restore) the following elements of a Custom Code block:
- The code itself (everything within the code editor field)
- The block's placement setting
- The description text
The Custom Code block's name will also be backed up, but will not be restored if the name of the block has changed since the backup was created.
Pause Custom Code backups for a Hub
You can pause backups for any Hub in your account at any time. When you do this (or if you simply don't enable backups for a Hub), Code Saver will skip that Hub during its daily backup cycle.
Pausing backups for a hub will only stop further backups from being made, and will not delete any previously created backups.
- To pause backups for a Hub, click on the toggle switch in the Hub's tile again:
- In the confirmation window, type Yes into the field, then click on the Pause button:
- The toggle switch will change to the "paused" state, and Custom Code in the selected Hub will no longer be backed up:
View and restore Custom Code backups
Code Saver will create backups of all Custom Code blocks in Hubs where backups are enabled. You can view backups for each Custom Code block individually, and restore a backup for any Custom Code block at any time.
Use Code Saver's Restore section to view available backups and restore selected backups. Available backups are organized by Hub, and the Restore section lists all Hubs for which backups are available:
View available backups
Click on a Hub in the Restore section to view available backups for that Hub:
This will show a list of all Custom Code blocks in the Hub. Use the Select Backup By Date dropdown under any Custom Code block to view available backups for that block:
The dates and times shown indicate when the Custom Code block was last modified — not when the backup was made.
If a Custom Code block hasn't been changed since the last backup, Code Saver will skip backing it up until it detects another change has been made.
Select and view a backup
Click on a backup listed in the Select Backup By Date dropdown to select it. When you select a backup, a View Code button will appear:
Click the View Code button to see the code that was backed up (and which will be restored to your Hub, if you choose to restore this backup), along with its placement:
This isn't just a preview — the View Code function shows all code that was backed up for the selected Custom Code block.
Restore a backup
You can restore a backup of any Custom Code block at any time. Restoring a backup will replace the current contents of the Custom Code block in the Hub with the code that was backed up, effectively returning the Custom Code block back to the same state when the backup was made.
Restoring a backup can NOT be undone! If the code that you replacing with the backup has not yet been backed up, you will not be able to recover it after the restore has been completed.
Always proceed with caution when restoring backups, and double-check that you are restoring the right backup for the right code block.
- To restore a backup, simply select the backup (using the Select Backup By Date dropdown), then click on the Restore button:
In the confirmation window, verify the Code Block name and backup are correct, then type the name of the Custom Code block into the field to confirm that you are sure you want to restore this backup:
- Click on the Restore button to proceed. Code Saver will restore the selected backup and display a confirmation message:
- At this point, the backed up code has been restored, but the Custom Code block has been disabled:
- To enable the restored code (and allow it to take effect on your Hub right away), click on the Enable button.
- If you want to verify the code before enabling it in the Hub manually, click on Cancel. You can check on the code in your Hub under Appearance > Custom Code.
- You're done!
View Code Saver activity logs
Code Saver maintains detailed logs of all activity (both activity the app performs itself, and activity which users perform in Code Saver).
Use Code Saver's Logs section to view detailed app activity logs. Logs are divided by Hub:
Click on a Hub to download the relevant activity logs for that hub. Logs will download as a plain text file (.txt):
Each line the log represents a user action, a backup or restore event, or an automatic backup event. Each entry consists of:
- Timestamp: The time/date (in Eastern Time) when the action or event occurred.
- Type: The kind of entry, which can be any of info, warning, or error.
- Message: A detailed description of the action or event that occurred.
- Code Saver organizes and displays available backups under the names of the Custom Code blocks, but backups are actually associated with the unique ID of their Custom Code block. If you rename a Custom Code block in Uberflip, that name change will also be reflected in Code Saver, and all previous backups will be shown under the new name. If you restore a backup from before a Custom Code block was renamed, the Custom Code block will not be reverted to the previous name — only the code, placement, and description will be restored.
- If you delete a Custom Code block that was previously backed up by Code Saver, those backups will still remain in Code Saver. When you restore a backup of a Custom Code block that has been deleted, Code Saver will recreate the Custom Code block in Uberflip, then restore the code within it. Code Saver will then also resume backing up the recreated Custom Code block (provided backups are enabled for the Hub).