Pages: [1]   Go Down

Author Topic: Lightroom - sharing catalogs and images between users  (Read 1691 times)

Robert Ardill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 658
    • Images of Ireland
Lightroom - sharing catalogs and images between users
« on: February 16, 2016, 10:47:35 am »

I understand that Adobe's workaround to a shared catalog is to put the catalog on an external drive and move this from user to user ... which is really quite a pain.  I've been using a simple system for some time that I thought I would share with you ... there's nothing very clever about it, but it is quite a bit more elegant than carrying hard drives around the house or office.

What I do is to use a batch file to start Lightroom (this is on a PC, but the same thing could be done on a Mac, obviously). The batch file checks to see if LR is running on any other PC by checking for the presence of the lock file.  If it is running then a message is displayed to that effect.  If it is not then the catalog is copied from the PC that last accessed it.  In order for this to work properly the images should be on a mapped drive (which could be a network drive or on one of the PCs), so that all the images are accessible (the same thing would apply to using an external drive if the images were not on the external drive).

Here is the batch file I use:

net use \\otherPC "password" /user:UserName /persistent:no
if exist "\\otherPC\Lightroom\Lightroom Catalogs\*.lock" (
echo Lightroom running in otherPC
pause
exit
)
xcopy "\\otherPC\Lightroom\Lightroom Catalogs\*.lrcat" "\\thisPC\Lightroom\Lightroom Catalogs\" /Y /D
start "" "C:\Program Files\Adobe\Adobe Lightroom\lightroom.exe"
exit

The same script is run on the other PC.

It could be extended for more than 2 users quite easily and it could also check for specific catalogs rather than any catalog.

Robert
« Last Edit: February 16, 2016, 02:20:35 pm by Robert Ardill »
Logged
Those who cannot remember the past are condemned to repeat it. - George Santayana

JeanMichel

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 524
Re: Lightroom - sharing catalogs and images between users
« Reply #1 on: February 16, 2016, 01:59:19 pm »

I am faced with a similar situation,but perhaps less demanding: I have LR4 running on an older MacPro; the OSX.6.8 prevents me to upgrade LR on that machine. All of my images are on 3 internal drives there. I now have an iMac, with LR CC on it. Are a few hiccups, the LR CC is running wonderfully. My issue is that my spouse plans to go through heritages on the MacPro,and assign ratings and keywords to those next summer using LR4, no development. Well, it appears that she will be able to do that as long as she or I save metadata to the files, which then can be read/imported by LR CC on the iMac. Perhaps not an elegant solution but workable.
Jean-Michel
Logged

aduke

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 446
Re: Lightroom - sharing catalogs and images between users
« Reply #2 on: February 16, 2016, 03:33:37 pm »

I understand that Adobe's workaround to a shared catalog is to put the catalog on an external drive and move this from user to user ... which is really quite a pain.  I've been using a simple system for some time that I thought I would share with you ... there's nothing very clever about it, but it is quite a bit more elegant than carrying hard drives around the house or office.

What I do is to use a batch file to start Lightroom (this is on a PC, but the same thing could be done on a Mac, obviously). The batch file checks to see if LR is running on any other PC by checking for the presence of the lock file.  If it is running then a message is displayed to that effect.  If it is not then the catalog is copied from the PC that last accessed it.  In order for this to work properly the images should be on a mapped drive (which could be a network drive or on one of the PCs), so that all the images are accessible (the same thing would apply to using an external drive if the images were not on the external drive).

Here is the batch file I use:

net use \\otherPC "password" /user:UserName /persistent:no
if exist "\\otherPC\Lightroom\Lightroom Catalogs\*.lock" (
echo Lightroom running in otherPC
pause
exit
)
xcopy "\\otherPC\Lightroom\Lightroom Catalogs\*.lrcat" "\\thisPC\Lightroom\Lightroom Catalogs\" /Y /D
start "" "C:\Program Files\Adobe\Adobe Lightroom\lightroom.exe"
exit

The same script is run on the other PC.

It could be extended for more than 2 users quite easily and it could also check for specific catalogs rather than any catalog.

Robert

This script will work except when both pc's run it at about the same time. The phrase "about the same time" means that the second PC does not run its script during the period when first one is performing its copy and before it has a chance to set .lock.

You can reduce the fatal time by defining your own lock file on one of the PC's. Have your script read the  lock file and, if it is unlocked, set the lock, then copy the catalog and start LR. The second PC would run a similar script, but would refer to the same lock file as the other. Doing this will reduce the danger time to the time needed to read, test and write the lock.

I spent a number of years looking for just this kind of logic in much more stringent environments and a correct solution actually takes some assistance from some special piece of hardware that allows multiple machines to ask the question "are you currently locked" and answering either "no, I wasn't but I am now" or "yes, sorry, try again later". This hardware also needs to take a request "please unlock" from the machine holding the lock.

Alan
Logged

Robert Ardill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 658
    • Images of Ireland
Re: Lightroom - sharing catalogs and images between users
« Reply #3 on: February 16, 2016, 04:13:51 pm »

This script will work except when both pc's run it at about the same time. The phrase "about the same time" means that the second PC does not run its script during the period when first one is performing its copy and before it has a chance to set .lock.

You can reduce the fatal time by defining your own lock file on one of the PC's. Have your script read the  lock file and, if it is unlocked, set the lock, then copy the catalog and start LR. The second PC would run a similar script, but would refer to the same lock file as the other. Doing this will reduce the danger time to the time needed to read, test and write the lock.

I spent a number of years looking for just this kind of logic in much more stringent environments and a correct solution actually takes some assistance from some special piece of hardware that allows multiple machines to ask the question "are you currently locked" and answering either "no, I wasn't but I am now" or "yes, sorry, try again later". This hardware also needs to take a request "please unlock" from the machine holding the lock.

Alan

Yes, there is the possibility of a conflict if 2 people run the batch file at the same time.  This is especially likely to happen if the network isn't too fast and the catalogs are large as it may take a significant time to copy the catalogs before launching Lightroom (which will also take some time).  Here is an improvement on the script that gets over this problem:

copy /y NUL \\thisPC\Lightroom\Lightroom Catalogs\temp.lock
net use \\otherPC "password" /user:UserName /persistent:no

if exist "\\otherPC\Lightroom\Lightroom Catalogs\*.lock" (
echo Lightroom running in otherPC
pause
del \\thisPC\Lightroom\Lightroom Catalogs\temp.lock
exit
)

xcopy "\\otherPC\Lightroom\Lightroom Catalogs\*.lrcat" "\\thisPC\Lightroom\Lightroom Catalogs\" /Y /D
start "" "C:\Program Files\Adobe\Adobe Lightroom\lightroom.exe"
del \\thisPC\Lightroom\Lightroom Catalogs\temp.lock
exit

But of course there is still the very slight chance that the users will hit run the script at exactly the same time.  Getting over this isn't easy as you say, so one solution is to give the other guy a shout before hitting the button :)

The worst case scenario though is that the edits (not saved to xmp) made by the first user to exit LR would be lost. So it would be very advisable to always have changes written to xmp.

Another possible improvement would be to pause for a few seconds after launching LR, then check again that there is no lockfile and if there is to scream blue murder, something like this:

copy /y NUL \\thisPC\Lightroom\Lightroom Catalogs\temp.lock
net use \\otherPC "password" /user:UserName /persistent:no

if exist "\\otherPC\Lightroom\Lightroom Catalogs\*.lock" (
echo Lightroom running in otherPC
pause
del \\thisPC\Lightroom\Lightroom Catalogs\temp.lock
exit
)

xcopy "\\otherPC\Lightroom\Lightroom Catalogs\*.lrcat" "\\thisPC\Lightroom\Lightroom Catalogs\" /Y /D
start "" "C:\Program Files\Adobe\Adobe Lightroom\lightroom.exe"

timeout /t 30 /nobreak

if exist "\\otherPC\Lightroom\Lightroom Catalogs\*.lock" (
mshta "javascript:alert('OTHER USER HAS STARTED LIGHTROOM ... STOP!!! NOW!!!!');"
)

del \\thisPC\Lightroom\Lightroom Catalogs\temp.lock
exit

Robert
« Last Edit: February 16, 2016, 04:19:12 pm by Robert Ardill »
Logged
Those who cannot remember the past are condemned to repeat it. - George Santayana
Pages: [1]   Go Up