DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Database Backup

 9 Replies
 1 Subscribed to this topic
 40 Subscribed to this forum
Sort:
Author
Messages
Growing Member
Posts: 78
Growing Member

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.

New Around Here
Posts: 0
New Around Here
Yes, if you are backing up your database with an SQL aware backup program like Windows Server Backup or you script it with SQLcmd you will see this
New Around Here
Posts: 0
New Around Here
Oh, pls upgrade that old version you have.
Growing Member
Posts: 78
Growing Member
I am not running anything other than ms sql server development version. Where would I find this list in my windows 10 system?
Veteran Member
Posts: 1182
Veteran Member
MVP
MVP
You're an MVP!

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

Michael Tobisch
DNN★MVP

DNN Connect
Growing Member
Posts: 78
Growing Member

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?

Veteran Member
Posts: 1182
Veteran Member
MVP
MVP
You're an MVP!

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)

Happy DNNing!
Michael

Michael Tobisch
DNN★MVP

DNN Connect
Growing Member
Posts: 78
Growing Member

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?

Veteran Member
Posts: 1182
Veteran Member
MVP
MVP
You're an MVP!
No. DNN itself does not create backups.

Happy DNNing!
Michael

Michael Tobisch
DNN★MVP

DNN Connect
Veteran Member
Posts: 1182
Veteran Member
MVP
MVP
You're an MVP!

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

Michael Tobisch
DNN★MVP

DNN Connect

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:

  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
  3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  5. No Flaming or Trolling.
  6. No Profanity, Racism, or Prejudice.
  7. Site Moderators have the final word on approving / removing a thread or post or comment.
  8. English language posting only, please.

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved