Backup Media Center Recording History NOT Recording Schedule

Post Reply
XenonKilla

Posts: 7
Joined: Fri Jan 31, 2014 4:16 am
Location:

HTPC Specs: Show details

Backup Media Center Recording History NOT Recording Schedule

#1

Post by XenonKilla » Fri Jan 31, 2014 4:55 am

I've just searched quite a bit on this forum as well as Google and seen several topics with people "talking" about the issue, however I didn't seem to find any actual solutions.

I'm wanting to know how I can backup my Media Center History? I'm well aware of how to backup my Recording Schedules etc. What I'm talking about is the actual History of shows that Media Center has already recorded. Every time I do clean installs on my system I use Sean's WMC Backup to backup/restore my Recording Schedule however then I'm left with no history so Media Center will re-record shows that have already been recorded before whereas normally it wouldn't do this because it would have a history of shows that it's already recorded.

I've already tried backing up the entire "C:\ProgramData\Microsoft\eHome" folder and then replacing it after the clean install however when I open Media Center everything is there EXCEPT the recording history. Schedule data and all my settings are all there, just no history.

Does anyone know where this list gets saved? Is it in the registry somewhere? Gotta be some way to back it up :problem:

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#2

Post by barnabas1969 » Tue Feb 04, 2014 9:02 pm

I think the history is stored in a Windows event log. I doubt that there is a way to import it from a different machine or an old installation on the same machine.

User avatar
CyberSimian

Posts: 516
Joined: Mon Jun 20, 2011 5:52 pm
Location: Southampton, UK

HTPC Specs: Show details

#3

Post by CyberSimian » Wed Feb 05, 2014 11:40 am

barnabas1969 wrote:I think the history is stored in a Windows event log.
There is an unfortunate confusion of meanings here:

(1) There is "history", meaning a list of the events that WMC has experienced. This is recorded in the WMC event log, with a subset of it displayed in the "History" selection of "View Schedule".

(2) There is "history", meaning the information that WMC retains in order to avoid recording the same programme twice.

On Vista, item (2) is contained in the file "recordings.xml"; Vista does not use the event log for this purpose. I would be surprised if Win7 were any different: item (2) is likely contained in whatever file(s) were the replacement for "recordings.xml".

-- from CyberSimian in the UK

User avatar
holidayboy

Posts: 2840
Joined: Sun Jun 05, 2011 1:44 pm
Location: Northants, UK

HTPC Specs: Show details

#4

Post by holidayboy » Wed Feb 05, 2014 6:24 pm

I'm pretty sure that the recordings history in question (2) (as opposed to the (1) version that CyberSimian refers to above) gets stored in the mcepg.-..db file for Win7/8.

When you delete / rebuild the database, the recordings history gets deleted along with it from what I can tell.

I don't know of any way to backup / restore the recordings history like you can with the recording schedule.

The only way I can think of that might be possible is to copy over the old .db file along with the matching mcepgX-X folder and then try to repair it somehow - maybe running a loadmxf command of some sort. I've never tried it so can't offer much in the way of ideas....

Maybe an interesting weekend project for when I get time - if nobody else works out a way before then :)
Rob.

TGB.tv - the one stop shop for the more discerning Media Center user.

User avatar
holidayboy

Posts: 2840
Joined: Sun Jun 05, 2011 1:44 pm
Location: Northants, UK

HTPC Specs: Show details

#5

Post by holidayboy » Wed Feb 05, 2014 6:39 pm

Just re-read post #1 and see that you've already copied the complete programdata/ehome folder over - when you do this, do you need to restore the recording schedule, or does that automatically appear just by doing the copy/paste?

Who's brave enough to clear the logs for MC in event viewer and see what happens - if the history is stored there, could it be as 'simple' as importing events into the log via the command line maybe?

http://www.windows-commandline.com/create-event/
Rob.

TGB.tv - the one stop shop for the more discerning Media Center user.

XenonKilla

Posts: 7
Joined: Fri Jan 31, 2014 4:16 am
Location:

HTPC Specs: Show details

#6

Post by XenonKilla » Thu Feb 06, 2014 6:53 am

Finally a Solution to the Problem!

barnabas1969 was half right in his reply. The MC history IS in fact saved in the Event Log BUT there IS a way to backup and restore.

The Media Center Recording History is saved in C:\Windows\System32\winevt\Logs\Media Center.evtx

This is the file that contains the History that shows up in the Event Viewer as well as Media Center.

To backup/restore your Recording History all you need to do is backup that single file and replace it after restoring/reinstalling etc. One issue that most people might find challenging is that this file cannot be replaced while Windows is running because the system has the file locked in use. I actually booted into a WinPE environment using a custom recovery disk that I made, and replaced the file from there. I tried to replace it in Safe Mode just to see if it works so others would have some kinda simple solution, but unfortunately Windows still has the file lockedin use even in Safe Mode. I checked in the Services to see if any of the Media Center services were running but none of them were so I'm not sure what process has this file locked. Perhaps if someone can figure out what process has this file locked it could be shutdown in order to replace the backup file and then restarted.

Steps I took to test that this works.
1) Backup the Media Center.evtx file (can be done in Windows)
2) Open the Event Viewer -> Applications and Services Logs -> Media Center
3) At this point you can see all your Media Center history in the middle box
4) Click on the Clear Log... button in the right had pane, then click the Clear button
5) Now Open Media Center and goto your recording History and you will see it's empty now
6) Reboot into different environment and replace Media Center.evtx with backup
7) Reboot back into Windows and open Media Center
8) All items are now back into the Recording History

Thanks to everyone who replied and especially to barnabas1969 who was able to focus my interest in the right direction. This was bugging the hell outa me for quite sometime now. Anytime I re-imaged my computer I would always lose my Recording History and had to deal with re-runs getting recorded. But now it looks like I don't have that problem anymore :thumbup:

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#7

Post by barnabas1969 » Thu Feb 06, 2014 1:56 pm

Care to share your steps for creating the custom boot disk? Or, perhaps just upload the ISO somewhere? I just put my new HTPC in production and I'm having the same problem with old episodes being recorded again.

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#8

Post by barnabas1969 » Thu Feb 06, 2014 3:22 pm

XenonKilla,

OK, so I think I found my own answer in the links at the bottom of this post. I haven't tried it yet though, so if there is something special that you did, please let me know. Also, does WinPE have a GUI with a file explorer of some sort, or did you just use the command line?

I've taken a quick peek at that file, and it is mixed ASCII and binary. There appears to be a binary header at the top of the file that includes the computer name and some other info. So, it appears that if the new PC has a different name from the old PC, then this could be an issue. I haven't gone into depth and examined the file in a hex editor yet, but I will.

Also, at the beginning of each new date in the file, there is another binary header. Not sure of the exact layout yet. I'm thinking that there must be a way to splice two files together.

http://www.microsoft.com/en-us/download ... x?id=30652
http://technet.microsoft.com/en-us/libr ... 93200.aspx
http://msdn.microsoft.com/en-us/library/hh825494.aspx

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#9

Post by barnabas1969 » Thu Feb 06, 2014 3:25 pm

I'm also thinking that there must be a way to make a program that splices log files together. Not sure I'd want to dive in that deep (not enough free time on my hands). However, I'm thinking that (worst case) a program could be written to read two event log files, find the delimiters between the header and the first log record, and then insert the older log records in front of the new ones.

I've also taken a peek at the Microsoft EventLog class documentation. It seems that a programmer could use this to splice two log files together more eloquently than using a brute force method as described in the paragraph above. Here's the doc:

http://msdn.microsoft.com/en-us/library ... .110).aspx

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#10

Post by barnabas1969 » Fri Feb 07, 2014 2:27 am

Looking deeper at the log on my laptop (which isn't being used to record TV), there is definitely a header at the top of the file. However, the computer name is not in the header... it is in each individual event record. I'll need to do some testing to determine if Media Center cares if an event record contains a computer name other than its own.

Each piece of data in the file is on a word boundary (one word = two bytes). Therefore, ASCII characters all appear to be separated by a null character (hex 00).

Each event record begins with two asterisks (hex 2A2A). Within an event record, individual data elements are delimited by hex FFFF.

The heading on the file is mostly nulls, but does contain some other data. I'm not sure what it means.

The end of the file is padded with a LOT of nulls. The last word of non-null data is at hex 083ED5 (540,373 decimal). It is padded to hex 110FFF (1,118,207 decimal). That means that the next time the file is expanded, the next byte will begin at 111000 hex. This is interesting because it's an even hex number. I need to look at the log files on more PC's (especially the ones I've actually recorded stuff on) to get more accurate info, but there are a couple of possibilities to the way the file must be padded.

Once I figure that out, it looks fairly simple to take a (newer) file from the new PC, write the header to an output file, then gather the event records from the old PC's log file, append them to the output file, and then append the records from the new PC's log file... and finally padding the end of the file with null words to make the new PC happy with the ending boundary of the file.

I would still appreciate help with the WinPE disk, unless it's as straight-forward as simply creating the disk per the Microsoft instructions on the pages I linked in post #8 above.

User avatar
CyberSimian

Posts: 516
Joined: Mon Jun 20, 2011 5:52 pm
Location: Southampton, UK

HTPC Specs: Show details

#11

Post by CyberSimian » Fri Feb 07, 2014 9:53 am

barnabas1969 wrote:Therefore, ASCII characters all appear to be separated by a null character (hex 00).
These are probably Unicode characters. Unicode on Windows consists of "wide characters", meaning that each character occupies two bytes, and hence allows up to 64K possible characters in a character set (important for "ideographic" character sets).

Now, it just so happens that the Unicode characters corresponding to the ASCII character set have one byte which is the same as the ASCII value, and a second byte which is null (hence what you have observed).

Programs such as "Notepad" can browse TXT files that are either ASCII or Unicode -- Notepad uses some logic to distinguish between them, and display them correctly.

-- from CyberSimian in the UK

DanB_DE

Posts: 25
Joined: Sun Jul 31, 2011 8:58 am
Location:

HTPC Specs: Show details

#12

Post by DanB_DE » Fri Feb 07, 2014 4:32 pm

barnabas1969 wrote:I would still appreciate help with the WinPE disk, unless it's as straight-forward as simply creating the disk per the Microsoft instructions on the pages I linked in post #8 above.
You have a PM.

DanB
#

cs51762

Posts: 13
Joined: Mon Aug 27, 2012 2:41 pm
Location:

HTPC Specs: Show details

#13

Post by cs51762 » Sun Jun 15, 2014 10:39 pm

barnabas1969 wrote:Looking deeper at the log on my laptop (which isn't being used to record TV), there is definitely a header at the top of the file. However, the computer name is not in the header... it is in each individual event record. I'll need to do some testing to determine if Media Center cares if an event record contains a computer name other than its own.

Each piece of data in the file is on a word boundary (one word = two bytes). Therefore, ASCII characters all appear to be separated by a null character (hex 00).

Each event record begins with two asterisks (hex 2A2A). Within an event record, individual data elements are delimited by hex FFFF.

The heading on the file is mostly nulls, but does contain some other data. I'm not sure what it means.

The end of the file is padded with a LOT of nulls. The last word of non-null data is at hex 083ED5 (540,373 decimal). It is padded to hex 110FFF (1,118,207 decimal). That means that the next time the file is expanded, the next byte will begin at 111000 hex. This is interesting because it's an even hex number. I need to look at the log files on more PC's (especially the ones I've actually recorded stuff on) to get more accurate info, but there are a couple of possibilities to the way the file must be padded.

Once I figure that out, it looks fairly simple to take a (newer) file from the new PC, write the header to an output file, then gather the event records from the old PC's log file, append them to the output file, and then append the records from the new PC's log file... and finally padding the end of the file with null words to make the new PC happy with the ending boundary of the file.

I would still appreciate help with the WinPE disk, unless it's as straight-forward as simply creating the disk per the Microsoft instructions on the pages I linked in post #8 above.
Hey, barnabas1969. Have you had a chance to work on this any? I just upgraded to a new HTPC and I've been messing around with this, but no luck. Thanks.
Mike Fields

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#14

Post by barnabas1969 » Sun Jun 15, 2014 10:42 pm

No, I've had lots going on in my life so I haven't had time to mess with the PC much. If you're building a brand new PC, I would think that you should be able to copy the file from the old PC. You'll probably have to stop some services, or perhaps boot in safe mode before you'll be able to replace the original file.

oakley516

Posts: 113
Joined: Sun Mar 16, 2014 9:59 pm
Location: LI, NY

HTPC Specs: Show details

#15

Post by oakley516 » Wed Jul 02, 2014 9:07 pm

XenonKilla wrote:I've just searched quite a bit on this forum as well as Google and seen several topics with people "talking" about the issue, however I didn't seem to find any actual solutions.

I'm wanting to know how I can backup my Media Center History? I'm well aware of how to backup my Recording Schedules etc. What I'm talking about is the actual History of shows that Media Center has already recorded. Every time I do clean installs on my system I use Sean's WMC Backup to backup/restore my Recording Schedule however then I'm left with no history so Media Center will re-record shows that have already been recorded before whereas normally it wouldn't do this because it would have a history of shows that it's already recorded.

I've already tried backing up the entire "C:\ProgramData\Microsoft\eHome" folder and then replacing it after the clean install however when I open Media Center everything is there EXCEPT the recording history. Schedule data and all my settings are all there, just no history.

Does anyone know where this list gets saved? Is it in the registry somewhere? Gotta be some way to back it up :problem:
The history of recorded shows that MC keeps only goes back for about two months, so its not that troublesome to restore your recording schedule without recreating this history.


The worst that would happen is that you would just have to delete any unwanted recordings that aired again during that time.

Space

Posts: 2841
Joined: Sun Jun 02, 2013 9:44 pm
Location:

HTPC Specs: Show details

#16

Post by Space » Fri Jul 04, 2014 8:42 am

I am curious as to why you think the Series history only goes back two months. That would seem to negate the purpose of having a list of recorded episodes in the first place.

I have seem WMC not record shows because they were already recorded (more than 2 months ago), so I don't believe this to be correct. I have also seen WMC record episodes that it already recorded (in the same Series), but I just assumed this was because of the way WMC keeps track of unique episodes being less then perfect.

oakley516

Posts: 113
Joined: Sun Mar 16, 2014 9:59 pm
Location: LI, NY

HTPC Specs: Show details

#17

Post by oakley516 » Sat Jul 05, 2014 5:43 am

Space wrote:I am curious as to why you think the Series history only goes back two months. That would seem to negate the purpose of having a list of recorded episodes in the first place.
Having two months of history doesn't negate the purpose of the history. The history is simply so WMC can ignore an airing of the same episode that a network might broadcast more than once. Many cable networks do this, and even some broadcast networks will broadcast the same episode twice in one week.

This is similar to the 28 Day Rule that is used by Tivo in their scheduling logic. In this respect, WMC actually looks for a repeat airing for twice as long as a Tivo will. There was a thread about this comparison on the old TGB, probably back in 2009 or so, but it seems those are gone. Microsoft seems to have eliminated a lot of the WMC info from their site. Just looking quickly, I can't find much about the recording history except in the help for troubleshooting problems with recording:

The following are reasons why a show might not record:

There was a conflict with another recording that had higher priority. You can see more information about priorities earlier in this topic.

A tuner was not available when the show was scheduled to record.

There was no available disk space and no recordings could be deleted to create more space to record. To learn how to delete recordings, see Managing recorded TV shows: frequently asked questions.

There are no updated Guide listings available for the scheduled recording. Make sure that the latest Guide data is downloaded in Windows Media Center. For more information, see Troubleshooting Guide downloading problems.

Restrictions that were set by the broadcaster or originator of the content prohibited the show from being recorded.

The show was recorded previously. Windows Media Center does not record a show in a series if it has already been recorded or deleted within the last eight weeks.

You have reached the limit of how many recordings are kept for a series. Either delete other recordings for the series or increase the limit of how many recordings can be kept for a series. To learn how to manage your recordings, see Managing recorded TV shows: frequently asked questions.

The TV broadcaster changed the schedule or channel number for a specific network or the show did not air.

There was no TV signal because the channel was not available, the TV signal was disconnected, or the tuner was disabled.

Your computer was turned off or lost power during the time the show was scheduled to record. Your computer must be turned on or in Standby, Away, or Hibernate mode to successfully record a show.

If you have a set-top box, the infrared (IR) control cable may have been disconnected, which prevented Windows Media Center from changing the channel to start the recording.


http://windows.microsoft.com/en-us/wind ... r-computer

Space

Posts: 2841
Joined: Sun Jun 02, 2013 9:44 pm
Location:

HTPC Specs: Show details

#18

Post by Space » Sat Jul 05, 2014 6:00 am

That is interesting, because it goes against what I have read several times about how it works. That link does only mention Vista, so there may be a chance that things have changed since then I suppose. I will have to keep a closer eye on this to see if I can confirm that it works this way, although I am pretty sure I have seen it not record shows that it otherwise should have because it had already recorded them several months (more than two) ago.

Another interesting thing is that there is a similar page that IS for the Win7 version of Windows Media Center (http://windows.microsoft.com/en-us/wind ... dia-center) but it doesn't even mention the "previously recorded" reason as one of the reasons a show would not record...

Thanks

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#19

Post by barnabas1969 » Sat Jul 05, 2014 11:46 pm

I think Oakley's info is for Vista or XP. Win 7 definitely keeps more than 2 months.

Post Reply