Can I just copy /media/### folders from one project to another?
Hello,
since packaging grabs my content pages but doesn't grab referenced media folders I am wondering if I can manually (by regular file copy) drop the required media folders into another project (provided that the same folder number is not existing there)? My concern are the media folder id's... and even if it is not existing in the moment I copy the folder I am running the risk that umbraco tracks folder numbers some place else and tries with a future media creation to use the same folder number.
(background: my project 1 is my development/staging project and project2 is the live site. I need to transfer portions of my staging content to the live site. My staging content are: some pages containing media references for images and videos (not to mix-up with media-node references: Example:
<demo_WebPage1 id="1200" parentID="1234" level="3" ... nodeName="Webpage1" urlName="webpage1" ... isDoc=""> ... any elements ... <demo_Video>/media/999/myVideo.wmv</demo_Video> </demo_WebPage1>
Please don't respond '... just just courier which takes care of media and node-id's...' ... I know that but my client doesn't pay for it, ok?
I also know that it is (in general) not a good idea to move parts of the content manually but I want to understand how umbraco handles media folders and if manually copying such media folders is without high risks, .e.g. like I can copy xslt files directly via the file system.
So, I found that the umbraco database only keeps track of media item content if I add images via MEDIA SECTION, however, since I don't do that and instead add the image via an upload datatype to the page directly I am getting a clear text path-references to the media (see: <demo_Video>/media/999/myVideo.wmv</demo_Video>)
If I now would copy the media/999 folder over to my live site all references should still be working in theory.
But I don't know HOW umbraco comes up with the media folder numbers like 999 in the example? Is umbraco just looking at the physical folders and takes a unused number or is the number tracked in the database. If the latter is the case I certainly can't just copy media folders.
So if you just copy over the files, then you would risk getting clashing ID's, either with files that already exist in your live site, or with files that might get created later.
I hope this clarifies things.
I don't have a alternate solution for you, since the moving of content is no easy task. Maybe the (free) CMSImport package could help you?
Yeah, moving content is indeed a little tricky. I would hope the umbraco could come up with something like a 'light version' of 'courier' which helps developers to transfer portions of content/media w/o the per/domain license fee. A developer license or so....
I'll take a look at CMSImport as well - again, Thanks!
Can I just copy /media/### folders from one project to another?
Hello,
since packaging grabs my content pages but doesn't grab referenced media folders I am wondering if I can manually (by regular file copy) drop the required media folders into another project (provided that the same folder number is not existing there)? My concern are the media folder id's... and even if it is not existing in the moment I copy the folder I am running the risk that umbraco tracks folder numbers some place else and tries with a future media creation to use the same folder number.
(background: my project 1 is my development/staging project and project2 is the live site. I need to transfer portions of my staging content to the live site. My staging content are: some pages containing media references for images and videos (not to mix-up with media-node references: Example:
<demo_WebPage1 id="1200" parentID="1234" level="3" ... nodeName="Webpage1" urlName="webpage1" ... isDoc="">
... any elements ...
<demo_Video>/media/999/myVideo.wmv</demo_Video>
</demo_WebPage1>
Please don't respond '... just just courier which takes care of media and node-id's...' ... I know that but my client doesn't pay for it, ok?
I also know that it is (in general) not a good idea to move parts of the content manually but I want to understand how umbraco handles media folders and if manually copying such media folders is without high risks, .e.g. like I can copy xslt files directly via the file system.
So, I found that the umbraco database only keeps track of media item content if I add images via MEDIA SECTION, however, since I don't do that and instead add the image via an upload datatype to the page directly I am getting a clear text path-references to the media (see: <demo_Video>/media/999/myVideo.wmv</demo_Video>)
If I now would copy the media/999 folder over to my live site all references should still be working in theory.
But I don't know HOW umbraco comes up with the media folder numbers like 999 in the example? Is umbraco just looking at the physical folders and takes a unused number or is the number tracked in the database. If the latter is the case I certainly can't just copy media folders.
Thanks,
Frank
Hi Frank
Umbraco uses the PropertyId to come up with the number. Example:
You create a page in umbraco that has 3 properties on it. They will now get ids like this:
MyPage (id: 1234)
- txtprop1 (id: 34567)
- txtprop2 (id: 34568)
- imgprop3 (id: 34569)
The next page you create would get something like
MyPage2 (id: 1235)
- txtprop1 (id: 34570)
- txtprop2 (id: 34571)
- imgprop3 (id: 34572)
So the images from the two pages would be store in:
/media/34569/filename.jpg
/media/34572/filename.jpg
So if you just copy over the files, then you would risk getting clashing ID's, either with files that already exist in your live site, or with files that might get created later.
I hope this clarifies things.
I don't have a alternate solution for you, since the moving of content is no easy task. Maybe the (free) CMSImport package could help you?
Hi Morton,
thanks for explaining -- I appreciate it.
Yeah, moving content is indeed a little tricky. I would hope the umbraco could come up with something like a 'light version' of 'courier' which helps developers to transfer portions of content/media w/o the per/domain license fee. A developer license or so....
I'll take a look at CMSImport as well - again, Thanks!
Frank
is working on a reply...