How to Backup and Restore Smart Check-In Data
Some of the Smart Check-In configuration that is set using the Kiosk Administrator can be backed up from one instance or older instance of Kiosk Services and restored to another.
The configuration is kept in a MongoDB and can be restored to another MongoDB deployed by a Kiosk Services template.
Info
Migration of the data in the MongoDB used by Smart Check-In requires shell access to the Adapter Hub machine along with permissions to run Docker commands (this will require superuser "root" access).
Backup Configuration for Smart Check-In Versions 2.0 or Higher
To back up the configuration, SSH into the Adapter Hub machine using a common tool such as PuTTY (or have physical access to its secure shell terminal). Run the following command and replace
The Kiosk Adapter Hub Service name is located in UIP > Adapter Hubs > Adapter Hub Services. The name that was given to the Kiosk Services template that is to be inserted in the command below can be found in the grid in the Name column.
Backup MongoDB Data Command
Note, in the sample command below, there are underscores “_”, separating the parts of the adapter hub service name to replace. The underscores stay, only replace the name in brackets <>. All other fields are not changed.
sudo docker exec $(sudo docker ps --filter name=hubsvc_<adapterhubservicename>_k_mongo -q) sh -c 'mongodump --db kiosk --archive' > kioskdb.dump
Example
After replacement with "Kiosk" as the adapter hub service name for the Kiosk services, the command would be:
sudo docker exec $(sudo docker ps --filter name=**hubsvc_Kiosk_k_mongo** -q) sh -c 'mongodump --db kiosk --archive' > kioskdb.dump
You may be prompted for your root account password to execute this command. Once complete, ensure that the file "kioskdb.dump" exists in your local directory on the Adapter Hub machine.
Backup Configuration for Smart Check-In Versions 1.8 or Lower
To back up the configuration, SSH into the Adapter Hub machine using a common tool such as PuTTY (or have physical access to its secure shell terminal). Run the following command and replace <adapterhubservicename> with the name of your Kiosk Adapter Hub Service configured in UIP. Replace <pwd> in the following command with the with the "mongoDbPassword" from the Adapter Hub Service template. Run the command.
Where to get the fields to replace in the command from the Kiosk Services template
{
"name": "KioskServices", ← Get the name of the service here
"version": "1.8.6",
"description": "Kiosk Services - secured mode with TLS - 1.8.6",
"properties": {
"User_Configurable_properties": "",
"Kiosk_services_images_change_if_you_want_to_upgrade": "",
"kioskAdminImage": "kioskservices-dev:kioskadmin-1.8.7",
"kioskServerImage": "kioskservices-dev:kioskserver-1.8.5",
"mongoImage": "mongo-dev:kiosk-4.2.3.9",
"Mongo_server_setting_change_with_caution_if_needed": "",
"mongoServer": "neckioskmongo",
"mongoServerPort": 27017,
"mongoDbUser": "kioskUser",
"mongoDbPassword": "N3cK10sku5r2020!", ← Get the Mongo DB Password here
"Constants_change_only_if_advised": "",
"kioskServerHttpPort": 8080,
"kioskServerTcpPort": 60081,
"kioskAdminPort": 10005
},
...
}
Backup MongoDB Data Command
To run the commands below, copy and replace the kiosk services name and MongoDB password where it is noted. Note, in the sample below, there are underscores “_”, separating the parts of the adapter hub service name to replace. The underscores stay, only replace the name in brackets <>. All other fields remain unchanged.
sudo docker exec $(sudo docker ps --filter name=hubsvc_<adapterhubservicename>_neckioskmongo -q) sh -c 'mongodump --authenticationDatabase admin -u kioskUser -p <pwd> --db kiosk --archive' > kioskdb.dump
Example
After replacement with "KioskServices" as the adapter hub service name and "N3cK10sku5r2020!" as the password, the command would be:
sudo docker exec $(sudo docker ps --filter name=hubsvc_KioskServices_neckioskmongo -q) sh -c 'mongodump --authenticationDatabase admin -u kioskUser -p N3cK10sku5r2020! --db kiosk --archive' > kioskdb.dump
You may be prompted for your root account password to execute this command. Once complete, ensure that the file "kioskdb.dump" exists in your local directory on the Adapter Hub machine.
Restore Smart Check-In Configuration from Backup (any version)
Info
Restoring backup data requires shell access to the Adapter Hub machine along with permissions to run Docker commands (this will require superuser "root" access).
If a new Adapter Hub machine was installed since taking the data backup, the kioskdb.dump file will need to be copied to the new Adapter Hub machine prior to performing the restore operations.
To copy the kioskdb.dump file from one Ubuntu server to another, download and install WinSCP to a Windows machine on the network. WinSCP facilitates connecting and transferring files to and from an Ubuntu machine and a Windows machine. Copy kioskdb.dump to /home/<logged in username> folder. This is the default folder that you will start in when using PuTTY.
To restore the data, SSH into the Adapter Hub machine using a common tool such as PuTTY (or have physical access to its secure shell terminal). Ensure that the file kioskdb.dump exists in your local directory on the Adapter Hub machine. Replace <adapterhubservicename> from the following commands with the name of the Kiosk Adapter Hub Service name from UIP. The Kiosk Adapter Hub Service name is found in UIP > Adapter Hubs > Adapter Hub Services. The name that was given to the Kiosk Services template that is to be inserted in the commands below can be found in the grid in the Name column.
Warning
If restoring to Kiosk 2.3 or earlier, Kiosk used MongoDB version 5. In that version, the executable was named “mongo”. In Kiosk 2.4 or later, MongoDB version 6 or 7 is used. Mongo changed the name of the executable to "mongosh" as of MongoDB 6. The commands below will need to be adjusted depending on the MongoDB version that is being restored to. If the wrong MongoDB executable name is used, you will get an error such as "sh: 1:mongo: not found" when running the commands below.
Restore Data to a MongoDB
sudo docker service scale hubsvc_<adapterhubservicename>_k_ksrv=0
sudo docker exec -i $(sudo docker ps --filter name=hubsvc_<adapterhubservicename>_k_mongo -q) sh -c "mongosh kiosk --eval 'db.dropDatabase()'"
sudo docker exec -i $(sudo docker ps --filter name=hubsvc_<adapterhubservicename>_k_mongo -q) sh -c 'mongorestore --archive' < kioskdb.dump
sudo docker exec -i $(sudo docker ps --filter name=hubsvc_<adapterhubservicename>_k_mongo** -q) sh -c "mongosh kiosk --eval 'db.KioskServer.drop()'"
sudo docker service scale hubsvc_<adapterhubservicename>_k_ksrv=1
You may be prompted for your root account password to execute these commands.
Verify Smart Check-In Operation
After restoring the data, ensure that you can sign in to Kiosk Admin and verify the restored data.
To access Kiosk Admin, you may need to install the Certificate Authority (CA) generated by the Kiosk Orchestrator as described in Initialize Kiosk Admin Configuration.
Ensure that the Global Configuration settings and License are configured properly.
Kiosk Administrator Restored Configuration
Between Smart Check-In versions, default data values and options may have changed. If a value has been removed it will not be seen after restoring. All settings should be physically reviewed to confirm they are restored as expected despite performing a complete Kiosk Services data migration. New features will need to be configured if they are to be used.
If upgrading and migrating from Smart Check-In 2.0 to Smart Check-In 2.3 or later here are some known configuration changes that will need to be reset in Kiosk Administrator after the database restore.
- /System Settings / PMS - The options for selecting the PMS types have changed. The PMS type will need to be selected and saved.
- /System Settings / Keycard - new options are available, old selections may be affected.
- /System Settings / Scan Data - new options are available, old selections may be affected.
- /Memberships - new options are available, old selections may be affected.
- /Guest Details - New page settings may require the option to use the feature to be re-enabled if it was enabled before backup. Restoring defaults is required to see the new default table option. The original field settings will need to be reset after performing "Restore Defaults" action on the Guest Details page.