- 30 Jan 2025
- 3 Minutes to read
- Print
- DarkLight
- PDF
Back Up and Restore LandingLens on Snowflake
- Updated on 30 Jan 2025
- 3 Minutes to read
- Print
- DarkLight
- PDF
This article applies to these versions of LandingLens:
LandingLens | LandingLens on Snowflake |
✖ | ✓ |
In LandingLens on Snowflake v1_2.45 and later, you can back up and restore the LandingLens application.
Having backup versions of the LandingLens application can be helpful if data is deleted that needs to be later recovered. For example, if a project in LandingLens is accidentally deleted, you can restore an earlier version of LandingLens that has that project. Additionally, if the LandingLens app is deleted, you can restore a backed up version.
Process Overview
In Snowsight, you configure how often you want a backup to be saved and the maximum number of backups that should be created. LandingLens then automatically creates backup files based on that schedule.
After the maximum number of backup files are created, LandingLens will delete the oldest file when it creates a new file.
You can restore a backup by running SQL commands in Snowsight.
How Does Suspending the LandingLens App Impact Backups?
Backup files are not created when the LandingLens application is suspended. Backup files will continue to be created once the LandingLens app resumes.
For more information about suspending and resuming the app, go to Snowflake Credit Management.
Create Backups of LandingLens
You can configure backup files of LandingLens to be automatically saved to a Snowflake stage.
- Create or identify the Snowflake stage that will store the backup files.
- Grant LandingLens access to the stage that will store the backups. To do this, go to Grant LandingLens Access to Stages. (You can also find the SQL commands in the app in Snowsight here: Settings > Backup Configuration.)
- Open Snowsight.
- Go to Data Products > Apps > LandingLens Visual AI Platform.
- Click Launch App.
- Click Settings.
- Expand the LandingLens Configs section.
- Enter the location of the stage in the Backup to stage field, using this format:
db_name.schema_name.stage_name
. - Specify how often you want a backup to be saved by entering a number in the Every box and selecting either Hours or Days from the drop-down menu.
- Enter the maximum number of backups to save in the Max backups to keep field.
- Click Save.
- Click Main.
- Click Refresh Installation. The installation must be refreshed for the changes to go into effect.
Get Backup Timestamps and Access Backup Files
If you want to restore a backup of LandingLens, you will run a SQL command that includes the filename of the backup file.
Backup files use the following naming convention, where <TIMESTAMP>
is the date and time the file was created: landinglens-backup-<TIMESTAMP>
.
The timestamp uses the ISO 8601 format: YYYYMMDDTHHMMSS
. For example, the timestamp 20250128T135104
indicates that the backup file was created on January 28, 2025, at 13:51:04.
To view the backup files so that you can get the timestamp, run the following command:
LIST @<YOUR_DB>.<YOUR_SCHEMA>.<YOUR_STAGE> PATTERN='landinglens-backup-*';
Or, you can open Snowsight and navigate to the stage that you’ve selected to save backup files to.
Restoring Backups of LandingLens
Before restoring a backup, read this entire section to understand the temporary app downtime and potential for data loss.
Restoring a Backup Replaces All Current Data
If you restore a backup, any data created in LandingLens after the backup was created will be lost. This includes but is not limited to new projects, uploaded images, and deployments. For example, if you create a project on Tuesday and then restore a backup from Monday, the new project will be lost.
Restoring a Backup Doesn’t Change the App Version
Restoring a backup doesn’t change the LandingLens app version. For example, if you are using LandingLens v1_2.47 and restore a backup created in v1_2.45, your app will remain on v1_2.47.
Restore a Backup
The process to restore a backup takes about 15 to 20 minutes. During that time, users will not be able to access LandingLens.
- If the LandingLens application has been deleted, re-install it and grant it access to the stage that has the backup files.
- Ensure that the LandingLens application is running (in other words, that it is not suspended). To do this:
- Open Snowsight.
- Go to Data Products > Apps > LandingLens Visual AI Platform.
- Click Launch App.
- Check that each service Status is Ready, Done, or Present. If any of the services aren't running, resume the app.
- From the APP_WIZARD page, click Support.
- Select the checkbox to acknowledge that running commands here may perform actions that can’t be undone.
- Expand the SQL Passthrough section.
- Enter the following command in the SQL Statement field. Replace these placeholders with your information:
<YOUR_DB>
,<YOUR_SCHEMA>
,<YOUR_STAGE>
, and<TIMESTAMP>
. To get the<TIMESTAMP>
, go to Get Backup Timestamps and Access Backup Files.CALL core.restore_backup('@<YOUR_DB>.<YOUR_SCHEMA>.<YOUR_STAGE>/landinglens-backup-<TIMESTAMP>');
- Click Run.
- Once the process is complete, the following message displays.
**Restore from backup @<YOUR_DB>.<YOUR_SCHEMA>.<YOUR_STAGE>/landinglens-backup-<TIMESTAMP> complete!
Check the Status of the Restore Process
If you’ve started the process to restore a backup file, you can check the status by running this command:
CALL core.check_logs('backupmanager.restore_backup',
'0', 'backupmanager-app-lndsvc');