Backup
Scifeon does not provide an on-premises backup systems, but we provide the following best practices:
- We recommend taking regular backups of the database according to your company policy.
- The only relevant application file to backup is the
appsettings.json
file. - Test your backup before moving into production, i.e. after the backup mechanism has been set up.
Application backup
Backup the application files by making a copy of the application files folder with a meaningful name, e.g. by appending the current date. For example, if the application files are placed in the folder c:\inetpub\scifeon\dev
, make a copy in the folder c:\inetpub\scifeon\dev_YYYYMMDD
.
Database backup
Backup the database Scifeon_
(change this) to the folder c:\backup
by running the following script:
DECLARE @name VARCHAR(50) -- database name
DECLARE @path VARCHAR(256) -- path for backup files
DECLARE @fileName VARCHAR(256) -- filename for backup
DECLARE @fileDate VARCHAR(20) -- used for file name
SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112)
-- specify database backup directory
SET @path = 'C:\Backup\'
-- specify database name
SET @name = 'Scifeon_'
SET @fileName = @path + @name + '_' + @fileDate + '.BAK'
BACKUP DATABASE @name TO DISK = @fileName
The backup above can be restored with the following script:
DECLARE @name VARCHAR(50) -- database name
DECLARE @path VARCHAR(256) -- path for backup files
DECLARE @fileName VARCHAR(256) -- filename for backup
DECLARE @fileDate VARCHAR(20) -- used for file name
-- specify database backup directory
SET @path = 'C:\Backup\'
-- specify backup database name
SET @fromName = 'Scifeon_'
-- specify restore database name
SET @toName = 'Scifeon_'
-- specify backup date (look in the backup path for the correct format)
SET @fileDate = ''
SET @fileName = @path + @fromName + '_' + @fileDate + '.BAK'
RESTORE DATABASE @toName FROM DISK = @fileName WITH REPLACE
For more advanced ways to backup SQL Server databases, please read Microsoft Docs.
Verifying backup
- Restore the backup into a completely new, empty database.
- Compare data between the backed up database and the new database with the compare script.
- Edit the
appsettings.json
of an existing Scifeon instance to use the new database and start Scifeon. Verify that everything works. - Compare data between the backed up database and the new database with the compare script. This is to verify that by running Scifeon the data have not changed.
The compare script is generated here: ...
Policies
Follow your company backup policy, if you do not have such, we recommend backing up the database at least once a week.