Move base pictures to new directory

soldstatic

Joined: 2005-06-18
Posts: 35
Posted: Fri, 2009-06-26 21:57

I have the pics up in the gallery, and just upgraded to G2. The transition is working fine, things are good, however, I have a new folder structure on my site etc and I'd like to imitate (eventually synchronize that) with the structure I want to use for Gallery.

Basically I have a /home/siteroot/gallery/userUpload directory where all my pictures are, and I'd like to instead have the pictures stored at /home/sitestorage/pictures/andy, and then make that my user upload directory

Anybody know how to do this? I'm fully stumped.

Thank you in advance!

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Fri, 2009-06-26 22:08

FAQ: How can I move my storage folder to another path?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
soldstatic

Joined: 2005-06-18
Posts: 35
Posted: Sat, 2009-06-27 06:01

no i don't think this is going to work... The pictures aren't in the gallery data folder.

I have

/home/site/gallery/
/home/g2data/
/home/site/gallery/userUpload

userUpload is where all the pics are now. I want it to be like this:

/home/site/gallery/
/home/g2data/
/home/newSite/Pictures/

So userUpload is now Pictures etc. Everything inside it is the same. just rename the folder, and move the source images. Not move the g2data folder, it's fine where it is. This is eventually going to synch to my laptop Pictures directory.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Sat, 2009-06-27 13:46

Are your pictures symlinked from /home/site/gallery/userUpload?

If not, or if you don't know what I'm talking about, then they are actually stored in /g2data/albums/

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
soldstatic

Joined: 2005-06-18
Posts: 35
Posted: Mon, 2009-06-29 13:54

No I don't think they are symlinked. When I rsync / scp I store them /home/site/gallery/userUplaod/.

I want to try to stay away from symlinking things, because I have my site back up to another linux box, where yet another backup is made to a windows machine (which doesn't support symlinks)

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Mon, 2009-06-29 14:02

Then I don't understand your question. Your upload directory is completely independent from Gallery and not tied to making any changes in Gallery. Unless you are using the Add Items plugin. Then all you need to do is go to Site Admin > Web / Server and specify a new path to allow uploads from the local server.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
soldstatic

Joined: 2005-06-18
Posts: 35
Posted: Mon, 2009-06-29 14:26

Right, it's not directly tied to gallery, except that it is the source of the files. So if I move those, then supposedly the thumbnails would remain, however the original res picture would not load. And if the thumbnails were refreshed, their source would be gone and all the pics would be broken.

For exampl: I had gallery 2 or something, and recently applied an upgrade. In order to do the update, I ran 'mv userUpload ../../../' so that it was out of the way, 'rm -rf /home/site/gallery', 'unzip newGallerySource.zip ./gallery/', 'cp oldConfig ./gallery/config.php' mv userUpload ./gallery/

Similar to that. The upgrade was fine, but I actually didn't do the mv userUpload directory until after I went through the update process. Then I browsed my gallery and the folder structure was all in tact with all the other stuff, but all thumbnails were broken and the original picture did not pull up. Once I moved it back, I clicked rebuild thumbnails, and eventually everything was just fine.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Mon, 2009-06-29 15:30
Quote:
however the original res picture would not load

If they are not symlinked then they have absolutely no tie with Gallery at all. When you import images they, the full size image, goes to /g2data/albums/AlbumName/ImageName.jpg

You can delete, rename, move those files from your upload directory all you want. If they are not symlinked to Gallery, then Gallery does not know about them.

If you're still not understanding me or think I'm not understanding you, please either post or PM me a URL to your site. If it would require a login for me to really see stuff, then please PM me a login.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
soldstatic

Joined: 2005-06-18
Posts: 35
Posted: Mon, 2009-06-29 16:00

well, I can't shell from work so I can't determine if they actually are symlinked or not... It may be symlinked, I just thought gallery knew where they were and used them there. I use the "add items from local server directory" option and have set that folder as the directory users can upload too. However, if I move the pics or delete them from this folder, I'm 99% sure they will disappear from gallery. I just want to make gallery use a different folder instead of that one.

site is "home.djandyj.com/gallery"

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Mon, 2009-06-29 16:27
Quote:
However, if I move the pics or delete them from this folder, I'm 99% sure they will disappear from gallery

If and only if they are symlinked. If they are not, then Gallery doesn't even know they exist until you go to add them from local server. After that it copies/imports them into g2data/albums/AlbumName/ImageName. Yes, using up twice the amount of space because the image is in 2 locations now.

If you are not using the symlink option, then you can delete that entire directory and nothing will happen. Of course, don't just go deleting it because I said so, if you do so without backing up then shame on you ;) Looking at the numbers of views, on your albums and photos it doesn't appear to be super high traffic, so you could just try renaming that directory and try it ;) If it breaks, rename it back.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
soldstatic

Joined: 2005-06-18
Posts: 35
Posted: Mon, 2009-06-29 17:45

Ya def not super high traffic, just my personal stuff. I'll rename it and see if it still works, maybe it just broke because I was coming at it for the first time after the upgrade.

If it still works then I guess I'll just move it and make the new directory the user Upload one for add local items feature.

Now, if I shell into the server and make new directories and put pics in the g2data/albums/ folder, it wouldn't automatically add / create albums and such would it? Cause that would be perfect....

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Mon, 2009-06-29 17:51
Quote:
Now, if I shell into the server and make new directories and put pics in the g2data/albums/ folder,

DO NOT DO THAT, EVER

There is little (no) need to ever go into g2data unless something is broken. Gallery handles everything under g2data

Quote:
it wouldn't automatically add / create albums and such would it?

No, that wouldn't work. You may want to look at this:
http://gallery.menalto.com/node/81010#comment-284733
http://codex.gallery2.org/Gallery2:User_Contributions

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
soldstatic

Joined: 2005-06-18
Posts: 35
Posted: Mon, 2009-06-29 18:26

Yea, if I did do it i am 99% sure that it would not work simply because the database wouldn't reflect those changes.

I haven't had a chance to check out those links that you also put on my other post yet, but I do appreciate them! I will check them out as soon as I get the folder moved. :)

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Mon, 2009-06-29 18:34
Quote:
Yea, if I did do it i am 99% sure that it would not work simply because the database wouldn't reflect those changes.

There's nothing about 99% here. It wouldn't work, period. Now with that said, if you have an existing image in Gallery, but replace it from the back end, then rebuild the thumbnail and resized images you can replace an image that way, it's a lot of work, but you can do it. But you cannot import images that way, no how, no way.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
soldstatic

Joined: 2005-06-18
Posts: 35
Posted: Mon, 2009-06-29 19:01

Well I had to say 99% cause I can always, ALWAYS be wrong. lol ;)