uSyncMigrations icon indicating copy to clipboard operation
uSyncMigrations copied to clipboard

Missing Media Properties

Open craigs100 opened this issue 2 years ago • 7 comments

Having just done a migration from Umb V7.15.10 in to V10.6.1 none of the Media items have arrived with height, width, size or type. Have checked on both Windows and Linux (just in case ;) ) They have to be regenerated by saving each media item individually :( Is there any way this can be fixed or is there some procedure that needs to be carried out by the dev doing the migration?

Thanks

craigs100 avatar Sep 06 '23 15:09 craigs100

I got around it by temporarily adding this to the master view:-

@inject IMediaService _mediaService

@{
        foreach (var item in _mediaService.GetByLevel(3)) {
        _mediaService.Save(item);
    }    
}

I only had 3 levels hence didn't bother going from GetRootMedia() and another foreach ;)

craigs100 avatar Sep 06 '23 16:09 craigs100

I think its probibly option b) we need something that goes through the media and saves the items, (we could have this as a post migration step) and then all the width / heights would be added.

I think it comes from importing the media config, before the media is physically in the right place, but i should be a one button "fix" media thing we can add (as well as maybe making it a migration step)

KevinJump avatar Sep 06 '23 18:09 KevinJump

Hey @KevinJump I had thought about it, I am thinking to introduce new interface which will allow to run actions post migration and would add 3 button Run Post Import Action. There might be other issues which might be automated by introducing simple action for it :).

bielu avatar Oct 13 '23 08:10 bielu

Hi,

I think (not at desk today) there are notifications that fire at the start and end of the migration, so you might not need to do anything to implement a post action.

KevinJump avatar Oct 13 '23 09:10 KevinJump

Have just attempted a 7.15.11 to 12.2.0 migration, the site has arrived with no media or templates in the back office even though the config files are all there in the exported files (couldn't use a package zip unfortunately due to issue #210 still being unresolved).

Also the site won't build because it's missing templates: error MSB3030: Could not copy the file /home/craig/DotNetCoreSites/CADS/Web/uSync/migrate/migration_data_2023_10_23_221319/data/Template/master/contact/Contact.config" because it was not found. This file exists in /CADS/Web/uSync/migrate/migration_data_2023_10_23_221319/ although I can see the filename is data\Template\master\contact\Contact.config. I guess dotnet/Linux is looking for a file called Contact.config at the expected path.

Noted I've ended up with both usync/migrate and usync/Migrate folders. Probably not a problem on Windows but a disaster on Linux. Wondering if this is why knickers appear twisted?

craigs100 avatar Oct 23 '23 22:10 craigs100

On line 14 of uSync.Migrations/Handlers/Seven/MediaMigrationHandler.cs the TargetFolderName should be "media" and not "Media". "Media" is correct for the source in V7 (and poss V8) but since V9 it has been "media". I'll PR in the morning if I get the chance.

craigs100 avatar Oct 23 '23 22:10 craigs100

the Media items have arrived with height, width, size or type

@craigs100 Have you seen this issue?

I'm looking to try and submit a pull request for this. Having a post-migration action to save all media is not practical for me as my client site has such a huge media library I am not going to have that in place where the migration is executed so need to ensure the original values are migrated.

ProNotion avatar Nov 13 '23 17:11 ProNotion