Jump to content
TNG Community

Media Links Corrupt After GEDCOM Upload


Kevin Muehring

Recommended Posts

Kevin Muehring

After recently installing a new GEDCOM, it appears that all of my media links in TNG have been corrupted. Media files are linked to the wrong people, clicking on a media filename on Individual Pages won't open media file and thumbnails don't match media file. I used 'Media Links' recovery in the Utilities and now none of the linked media files appear on Individual Pages. The procedure I used for creating and uploading the GEDCOM is the same as I've done many times before, with no problems. I use Family Tree Maker to create the GEDCOM and everything is fine on there. What could have went wrong? Is there any recovery from this?

Link to comment
Share on other sites

Did you import a GEDCOM of your entire Family Tree Maker file, and import that into TNG with the "Replace All" option chosen?

Did you make a backup of your entire site before you did this import?

Roger

Link to comment
Share on other sites

Kevin Muehring

I think I found the problem. I opened the uploaded GEDCOM file and saw that most of the media file information was missing. The problem is with my FTM media folder. Somehow it got corrupted. I'm in the process of rebuilding the folder and I'm pretty sure this will solve the problem. Thanks for responding Roger.

Kevin

Link to comment
Share on other sites

Kevin Muehring

I don't think this is an FTM problem. It was self induced. I had problems with my media files a few months ago, so I created a new tree in FTM (more than once), generated a GEDCOM and uploaded it to my site not realizing that this would re-sequence the Person IDs. Media files were linked to the correct Person ID, but the person changed with the new GEDCOM upload, so now everyone in my tree has media files linked to them that are incorrect. These incorrect links are left over from previous GEDCOMs and I don't know an efficient way to remove them. I suppose there's a way to do it in the database, but my database skills are quite rusty. Thanks for responding, Chris. 

 

Link to comment
Share on other sites

4 minutes ago, Kevin Muehring said:

I don't think this is an FTM problem. It was self induced. I had problems with my media files a few months ago, so I created a new tree in FTM (more than once), generated a GEDCOM and uploaded it to my site not realizing that this would re-sequence the Person IDs. Media files were linked to the correct Person ID, but the person changed with the new GEDCOM upload, so now everyone in my tree has media files linked to them that are incorrect. These incorrect links are left over from previous GEDCOMs and I don't know an efficient way to remove them. I suppose there's a way to do it in the database, but my database skills are quite rusty. Thanks for responding, Chris. 

 

If you haven't done any other changes in TNG apart from what gets imported from a GEDCOM file, then you could use TNG Admin ------> Utilities - to back up all your tables and the table structure.

Then restore the table structure, and the TNG Users table and then import a correct GEDCOM file.

This will have the effect of starting over.

Roger

Link to comment
Share on other sites

Kevin Muehring

Hi Roger. I did the procedure you specified...backup tables, backup table structure, restore table structure, restore Users Table, import GEDCOM. 

Everything looks correct except the Photos. I must need to do another step. No Photos are showing up (I store all of my Media in the Photos Folder). Do I need to Restore the Media Table? The Media Filenames are showing up, but no photos or thumbnails.

It appears I've lost the link to my Collections. On the 'Media' pull down menu, there's no longer a link to "Photos', 'Histories', 'Videos', 'Recordings', etc. When I try to create a 'Photos' collection, I get an error message saying one already exists. How do I re-establish the link to my Collections?

Thanks,

Kevin

Link to comment
Share on other sites

Dang - I missed out a step..

After backing up the tables, to to the Tab to Create the Tables - this creates a new default empty tables for TNG, then restore the Table Structures and the Users table and it should then work - the Collections information is stored in the tng_mediatypes table.

And I've just now realised you asked this in two different places and I didn't make the connection it was the same person - using phpMyAdmin to empty the tng_media and tng_medialinks tables also sorts out this kind of mess.

Roger

Link to comment
Share on other sites

Kevin Muehring

I followed your procedure and the results are the same. The tng_Media and tng_Medialinks tables are populated and seem to be correct, but the tng_Mediatypes table is empty. The native TNG mediatypes (Photos, Documents, Headstones, Histories, Videos and Recordings)  don't seem to be available anywhere on the site.

Link to comment
Share on other sites

After you Created new tables was the tng_mediatypes table still empty? The script that creates the tables includes this

$query = "DROP TABLE IF EXISTS $mediatypes_table";
$result = performQuery($query);
$query = "CREATE TABLE $mediatypes_table (
	mediatypeID VARCHAR(20) NOT NULL,
	display VARCHAR(40) NOT NULL,
	path VARCHAR(127) NOT NULL,
	liketype VARCHAR(20) NOT NULL,
	icon VARCHAR(50) NOT NULL,
	thumb VARCHAR(50) NOT NULL,
    exportas VARCHAR(20) NOT NULL,
	disabled TINYINT(4) NOT NULL,
	ordernum TINYINT(4) NOT NULL,
	localpath VARCHAR(250) NOT NULL,
	PRIMARY KEY (mediatypeID),
	INDEX ordernum (ordernum, display)
) ENGINE = MYISAM $collationstr";
$result = performQuery($query,$mediatypes_table);

$query = "INSERT IGNORE INTO $mediatypes_table (mediatypeID,display,path,liketype,icon,thumb,exportas,disabled,ordernum,localpath) VALUES('photos','','','','','','',0,0,'')";
$result = performQuery($query);
$query = "INSERT IGNORE INTO $mediatypes_table (mediatypeID,display,path,liketype,icon,thumb,exportas,disabled,ordernum,localpath) VALUES('documents','','','','','','',0,0,'')";
$result = performQuery($query);
$query = "INSERT IGNORE INTO $mediatypes_table (mediatypeID,display,path,liketype,icon,thumb,exportas,disabled,ordernum,localpath) VALUES('headstones','','','','','','',0,0,'')";
$result = performQuery($query);
$query = "INSERT IGNORE INTO $mediatypes_table (mediatypeID,display,path,liketype,icon,thumb,exportas,disabled,ordernum,localpath) VALUES('histories','','','','','','',0,0,'')";
$result = performQuery($query);
$query = "INSERT IGNORE INTO $mediatypes_table (mediatypeID,display,path,liketype,icon,thumb,exportas,disabled,ordernum,localpath) VALUES('recordings','','','','','','',0,0,'')";
$result = performQuery($query);
$query = "INSERT IGNORE INTO $mediatypes_table (mediatypeID,display,path,liketype,icon,thumb,exportas,disabled,ordernum,localpath) VALUES('videos','','','','','','',0,0,'')";
$result = performQuery($query);

which creates the table, AND enters the 6 rows into it for photos, documents, headstones, histories, recordings and videos

Roger

Link to comment
Share on other sites

Kevin Muehring

I also just discovered that the tng_users table is empty as well. Something must have happened when I was doing the backup/restore procedures to these tables. Not good.

Link to comment
Share on other sites

If you look in the backup files you've made for say the tng_users table does it show any content, or is it empty?

Did you back it up first?

When you use the tab in Setup to "Create Tables" it will create most to the tables empty, with the exception that the tng_mediatypes table should have 6 rows in it as noted above.

Roger

 

Link to comment
Share on other sites

Kevin Muehring

The tng_users and tng_mediatypes tables are both empty. All other tables look OK.B

I did back them up, but I think they were empty when I backed them up. image.png

This is what's in the tng_mediatypes table:

image.pngimage.png

Link to comment
Share on other sites

Have you since this run the "Create Tables" that is in the tab Table Creation in the Setup menu section of TNG Admin?

This should create the tables over from new, and put 6 rows into the tng_mediatypes table.

Roger

Link to comment
Share on other sites

Kevin Muehring

I just ran the "Create Tables" function and I now have the 6 native TNG mediatypes. Thanks Roger! I uploaded my latest GEDCOM and so far, everything looks OK, except I lost all of my User information. I have a fairly recent Full Site Backup and I'm wondering if I can use that to recover the User info.

Link to comment
Share on other sites

If you have a copy of the file tng_users.bak that has the users listed in it, then you can put that in your backups folder and then restore just that table.

Roger

Link to comment
Share on other sites

Kevin Muehring

I tried that, but unfortunately the tng_user.bak file is empty . I'm learning a lot from my stupid mistakes. I must have done the backup/restore evolution in the wrong order. I somehow must have emptied the tng_users table before backing it up, then restored an empty table. Everything else seems to be OK. My medialinks are all correct now, which was the original problem that I was trying to fix. Any other ideas for recovering the users?

Link to comment
Share on other sites

You could try your hosting service to see if they have a back up of either the entire database, or if you think there's a chance there was a backup that actually did have some data in it, then a backup of just the tng_users table.

Explain to them carefully what you want - you don't want them restoring the entire database for example!

Roger

Link to comment
Share on other sites

Kevin Muehring

I was just looking at that. They have a utility with Recovery Points that store full site backups. I can go back to a Recovery Point before I screwed up the tng_users table and restore it. The problem is, the only option is to restore ALL tables. I suppose I could do that then implement your original fix again:

1. Backup Tables

2. Backup Table Structure

3. Create Tables

4. Restore Table Structure

5. Restore Users Table

6. Import GEDCOM File

Thanks for your help,

Kevin

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...