I am currently running dnn 9.7.2, and have always known of page under settings>servers>database where there is a list of what looks like database backups - are these for real, and were are they located on server? What are they supposed to show? Looks like every day a backup was made going back 20 days or so.
If you are looking for a script to display your database backups, here is one that displays the backups for the last 7 days:
<code>SELECT<br /> CONVERT(CHAR(100), SERVERPROPERTY('Servername')) AS Server,<br /> msdb.dbo.backupset.database_name,<br /> msdb.dbo.backupset.backup_start_date,<br /> msdb.dbo.backupset.backup_finish_date,<br /> msdb.dbo.backupset.expiration_date,<br /> CASE msdb..backupset.type<br /> WHEN 'D' THEN 'Database'<br /> WHEN 'L' THEN 'Log'<br /> END AS backup_type,<br /> msdb.dbo.backupset.backup_size,<br /> msdb.dbo.backupmediafamily.logical_device_name,<br /> msdb.dbo.backupmediafamily.physical_device_name,<br /> msdb.dbo.backupset.name AS backupset_name,<br /> msdb.dbo.backupset.description<br /> FROM<br /> msdb.dbo.backupmediafamily<br /> INNER JOIN msdb.dbo.backupset ON msdb.dbo.backupmediafamily.media_set_id = msdb.dbo.backupset.media_set_id<br /> WHERE<br /> (CONVERT(datetime, msdb.dbo.backupset.backup_start_date, 102) >= GETDATE() - 7)<br /> ORDER BY<br /> msdb.dbo.backupset.database_name,<br /> msdb.dbo.backupset.backup_finish_date </code>
(Source: Script to retrieve SQL Server database backup history and no backups (mssqltips.com))
Feel free to modify for your needs.
Happy DNNing! Michael
Hi thanks for the reply Michael,
Interesting, now I see where they are - but how can they used? Like restoring or even converting to a .dat file?
Is there any way to change behavior like instead of sending to database tables, just put in a folder somewhere?
I figured out how to restore from them, but from where is database being told to backup(dnn, ms sql server?), can the times be configured?
You can restore them - even to another database - using the RESTORE command in SQL:
RESTORE (Transact-SQL) - SQL Server | Microsoft Learn
Converting them to a .dat file (whatever this is) is not possible. But the extension in SQL Server is not so important (even if .bak is common for data backup files and .trn for transaction log backups), eg. if you backup your files using
<code>BACKUP DATABASE xyz TO DISK='C:\Temp\xyz.dat'</code>
you can restore it by
<code>RESTORE DATABASE abc FROM DISK='C:\Temp\xyz.dat'</code>
In this case you get an additional database called abc containing the data of xyz at the moment of the backup.
To have a nice (and free) backup solution have a look at SQL Server Backup, Integrity Check, Index and Statistics Maintenance (hallengren.com), and for restore you can use sp_DatabaseRestore: Open Source Database Restore Stored Procedure - Brent Ozar Unlimited®.
Also bread my blog post here: Implementing Ola Hallengren's Maintenance Solution on SQL Server Express (dnncommunity.org)
Hi Michael,
Thank you for your response again but, do you know where the backup command is generated - like does dnn give the command?
If so are there settings for this?
Sorry for being a bit short yesterday evening... it was just a quick answer from my mobile. There can be different places to look for the "source" of the backup command, I would start with the Windows Scheduled Task Manager and look if there is some script called that does the backup. If you are not using SQL Server Express, there could also be a job in the SQL Server Agent - use SQL Server Management Studio (SSMS) to find. And there could also be a Maintenance Plan in SQL Server, use SSMS and go to Management :: Maintenance Plans to find. And even as DNN itself does not do backups, there could be a module that installs a task in the DNN Task Scheduler to do a backup. This could be Evotiva Backup for instance. Happy DNNing! Michael
These Forums are for the discussion of the open source CMS DNN platform and ecosystem.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.