MediaPortal scheduled backup using WinRar (now including SQLExpress database) (1 Viewer)

Terriff

Portal Pro
March 28, 2008
75
3
I am having problems with this on Vista. I get the following message when I try and run the .bat

Backing up database...
Msg 911, Level 16, State 11, Server HTPC-1\SQLEXPRESS, Line 5
Could not locate entry in sysdatabases for database 'MediaPortal'. No entry found with that name. Make sure that the name is entered correctly.
Msg 3013, Level 16, State 1, Server HTPC-1\SQLEXPRESS, Line 5
BACKUP DATABASE is terminating abnormally.
Deleting backup archives older than 7 days...
'E:\mediaportal' is not recognized as an internal or external command,
operable program or batch file.
Backup complete.
E:\mediaportal backup>

I am not familiar with using SQLExpress but when I look under Databases there are two System Databases named
MpTvDbRC1 and TvLibrary.

Why do I need to change to fix the backup?
Look for the following variable in MediaPortalBackup.bat and set it to your database name:

  • SET DatabaseName=MediaPortal

You would replace MediaPortal with MpTvDbRC1 or TvLibrary, whichever database you are actually using for your installation.
 

entrecour

MP Donator
  • Premium Supporter
  • September 11, 2007
    75
    5
    Home Country
    United Kingdom United Kingdom
    Thanks - that worked nicely once I had created the subdirectory for the backup!

    I had to modify the Forfiles line as follows to work on Vista

    @ForFiles.exe /p "%ForFilesBackupLocation%" /m "%BackupName%*.rar" /d -%DaysToKeepBackups% /c "cmd.exe /c DEL @FILE /Q"

    You don't delete the .bak file in the cleanup section, is there a reason for that?

    Thanks again!
     

    Terriff

    Portal Pro
    March 28, 2008
    75
    3
    Thanks - that worked nicely once I had created the subdirectory for the backup!

    I had to modify the Forfiles line as follows to work on Vista

    @ForFiles.exe /p "%ForFilesBackupLocation%" /m "%BackupName%*.rar" /d -%DaysToKeepBackups% /c "cmd.exe /c DEL @FILE /Q"
    Ya, ForFiles is very picky with the switch syntax depending on which version you use (I'm assuming that you're using the version that comes with Vista and not the version included in the archive in the first post). I'm thinking that I'll get rid of the dependency on ForFiles completely and use RoboCopy or something.

    You don't delete the .bak file in the cleanup section, is there a reason for that?

    Thanks again!

    I really just left the file as it gets overwritten every night with the new backup. Really, just laziness, that's all. :)
     

    huha

    Extension Developer
    January 3, 2008
    890
    556
    Home Country
    Germany Germany
    Another alternative for backup/restore of Tv Server and MediaPortal settings can be found here: BackupSettings
    It can be used with/without Tv server being installed
     

    ccna55

    Portal Member
    June 16, 2009
    43
    3
    Home Country
    United States of America United States of America
    Naming convention for backup script.

    To all i have not seen this on the thread and i use this backup program everyday successfully.
    I have been helped many times so i hope i can help a few users with this tip.
    In order for the backups to get deleted in X amount of days you must use Dos naming conventions
    for at least "SET UtilityFilesPath="..Mine were not automatically being removed until i changed that line.
    i also changed the "SET ForFilesBackupLocation=" to Dos

    Example =
    Normal
    D:\PROGRAM FILES\TEAM MEDIAPORTAL\BACKUP
    Dos name
    D:\PROGRA~1\TEAMME~1\BACKUP

    If you want to know what the name would be just do this.
    Basically just cd to the directory you want to see the dos name
    and issue the command "command" without quotes.

    D:\Program Files\Team MediaPortal\Backup>command
    Microsoft(R) Windows DOS
    (C)Copyright Microsoft Corp 1990-2001.

    D:\PROGRA~1\TEAMME~1\BACKUP>

    i apologize if i missed this somewhere else.

    Thanks,
    ccna55
     

    Terriff

    Portal Pro
    March 28, 2008
    75
    3
    To all i have not seen this on the thread and i use this backup program everyday successfully.
    I have been helped many times so i hope i can help a few users with this tip.
    In order for the backups to get deleted in X amount of days you must use Dos naming conventions
    for at least "SET UtilityFilesPath="..Mine were not automatically being removed until i changed that line.
    i also changed the "SET ForFilesBackupLocation=" to Dos
    ...

    Nice catch! I never ran into this as my current directory is D:\Backups, which falls under the DOS 8.3 naming constraint
     

    Users who are viewing this thread

    Top Bottom