I've followed this and although it does create the nodes in the Media Dashboard of the Folders, Images, and Files, each one is empty?
I'm assuming it may have something to do with the sequential folder numbering in Umbraco 7 and the random character folder naming convention in Umbraco 8?
Has anyone successfully moved the Media from V7 to V8 before?
Yeh moved the physical Media folder over to the new Umbraco 8 instance Media folder, so it has all the internal folders 1008.1009.1010 and so on.
I think on the import, the URL is not being set from the XML URL value? I assume this hasn't changed in the latest version of Umbraco 8 and that you can still programmatically change that URL upon the creation of a Media item?
I ran the other code to heal the crops and can see that mediaFromCache.Url is always empty, which would suggest it's not been set in the first place?
I haven't tried my code for this in a while actually. It could be that something has changed in newer versions, making the code not work. Other people have told me they used the blog post and it worked for them but that was a while ago. Did you check you had set the right windows permissions on the folders?
I'm going to do some more testing this morning, with a sub-set of files and images. Stupidly I just ran the code thinking it would work Ok and shifted about 1.5GB worth of Media into the new Umbraco 8 install. So it's taken a while to remove and start again with it (lesson learned :) )
All the folders/files have the correct folder permissions, I can create Media from the back office and it does save out Ok, Umbraco 8 now uses a random string for the media folder rather than a sequential number.
I'm going to do the same as you and save out a file and an image from the back office, look at the Examine output and marry that up with what gets imported, and see if there is any difference.
Seems to work fine now? All media is being added correctly.
Once the import is completed (1.5GB) I'll check if the crops need healing and report back here.
Hello, I've been trying a media import from Umb v7 to v10 using a method similar to the one in Paul's page. The script runs and creates all of the media noes in the backoffice with the correct names, but it doesn't actually upload any the images.
The XML feed I am using has the URL like this:
<Url>/media/1004/70s.jpg</Url>
But I'm not sure where I should be storing the media locally. We use Azure blob storage for site media but I'm wondering if that is the problem.
I have tried in the root of the project, in the /media folder and also in the wwwroot folder.
I managed to get this working in Umbraco V10 by making a small change to the code in Paul's example.
var media = service.CreateMedia(nodeName, parentFolderId, nodeTypeAlias);
if (nodeTypeAlias.ToLower() == "image" || nodeTypeAlias.ToLower() == "file")
//media.SetValue("umbracoFile", JsonConvert.SerializeObject(new ImageCropperValue { Src = mediaPath }));
media.SetValue("umbracoFile", mediaPath);
if (key != Guid.Empty)
{
media.Key = key;
}
service.Save(media);
return media.Id;
The issue was with the nodeTypeAlias being lowercase. So that part of the code was not executing. The blob storage thing doesn't appear to be an issue. The images have now appeared in the backoffice and I simply made sure they were all pushed to the blob container and in the same location that newly created images are placed e.g 'containername/media/media'.
Files also came through ok. Still some more testing to do but looking good at the moment.
Oh and BTW, 'alt template' seems to just work in Umb10 with no additional code needed.
Moving Media from Umb V7 to Umb V8
I'm needing to move media from a V7 Umbraco site to a new install of Umbraco 8.
Paul Seal has done a great blog post about moving the media here from v7 to v8 - https://codeshare.co.uk/blog/how-i-migrated-my-umbraco-v7-site-to-v8-part-1-media/
I've followed this and although it does create the nodes in the Media Dashboard of the Folders, Images, and Files, each one is empty?
I'm assuming it may have something to do with the sequential folder numbering in Umbraco 7 and the random character folder naming convention in Umbraco 8?
Has anyone successfully moved the Media from V7 to V8 before?
Hi Neil
Did you try general content migration guide? - https://our.umbraco.com/Documentation/Fundamentals/Setup/Upgrading/migrating-to-v8
Thanks,
Alex
Hi Neil Did you put the media files on disk in your v8 site?
That should work.
Morning Paul
Yeh moved the physical Media folder over to the new Umbraco 8 instance Media folder, so it has all the internal folders 1008.1009.1010 and so on.
I think on the import, the URL is not being set from the XML URL value? I assume this hasn't changed in the latest version of Umbraco 8 and that you can still programmatically change that URL upon the creation of a Media item?
I ran the other code to heal the crops and can see that
mediaFromCache.Url
is always empty, which would suggest it's not been set in the first place?Hi Neil
I haven't tried my code for this in a while actually. It could be that something has changed in newer versions, making the code not work. Other people have told me they used the blog post and it worked for them but that was a while ago. Did you check you had set the right windows permissions on the folders?
Hi Paul
I'm going to do some more testing this morning, with a sub-set of files and images. Stupidly I just ran the code thinking it would work Ok and shifted about 1.5GB worth of Media into the new Umbraco 8 install. So it's taken a while to remove and start again with it (lesson learned :) )
All the folders/files have the correct folder permissions, I can create Media from the back office and it does save out Ok, Umbraco 8 now uses a random string for the media folder rather than a sequential number.
I'm going to do the same as you and save out a file and an image from the back office, look at the Examine output and marry that up with what gets imported, and see if there is any difference.
I'll report back here with what ive found.
HI
So to follow up on this. Seems the Media path can be set Ok.
I changed the line :
to just:
Seems to work fine now? All media is being added correctly. Once the import is completed (1.5GB) I'll check if the crops need healing and report back here.
Ah yes, of course. There is a new media picker now. That will be the cause of the problem.
Yeh, upgraded to 8.16 and realised there's and new Media Picker, brought in on an earlier version.
At least its a simple fix ;)
Hello, I've been trying a media import from Umb v7 to v10 using a method similar to the one in Paul's page. The script runs and creates all of the media noes in the backoffice with the correct names, but it doesn't actually upload any the images.
The XML feed I am using has the URL like this:
But I'm not sure where I should be storing the media locally. We use Azure blob storage for site media but I'm wondering if that is the problem. I have tried in the root of the project, in the /media folder and also in the wwwroot folder.
I managed to get this working in Umbraco V10 by making a small change to the code in Paul's example.
The issue was with the nodeTypeAlias being lowercase. So that part of the code was not executing. The blob storage thing doesn't appear to be an issue. The images have now appeared in the backoffice and I simply made sure they were all pushed to the blob container and in the same location that newly created images are placed e.g 'containername/media/media'. Files also came through ok. Still some more testing to do but looking good at the moment.
Oh and BTW, 'alt template' seems to just work in Umb10 with no additional code needed.
is working on a reply...