stashapp / stash

An organizer for your porn, written in Go. Documentation: https://docs.stashapp.cc
https://stashapp.cc/
GNU Affero General Public License v3.0
8.8k stars 778 forks source link

[RFC] Two instances at once? #4543

Closed AceidicDawn closed 7 months ago

AceidicDawn commented 7 months ago

Is there currently any way to seperate my database into two and have them both run at once?

Maybe i'm going about this in a strange way but I'm a bit of a datahoarder and one thing i have is thousands of tiktok videos, i'd love these in Stash, but currently with that many videos the main app slows down tremendously while trying to search through other videos and such.

So i'd like to know if i could have two instances of Stash running at once, allowing me to have different smaller databases for the exact things i want at the time?

WeedLordVegeta420 commented 7 months ago

Should be doable running in separate docker instances.

AceidicDawn commented 7 months ago

Can you elaborate on this? I'm not sure what docker is and how to run seperate instances of it.

DingDongSoLong4 commented 7 months ago

@AceidicDawn You don't need Docker, you can easily run multiple Stash instances with a normal setup.

When looking for a config.yml file, Stash first looks in the current directory (which will usually be the folder that contains stash-win.exe (I'm assuming you're on Windows), and then if it doesn't find one there, it looks in C:\Users\{username}\.stash.

So because you're going to now be running multiple config files, if you have your Stash currently set up to use the C:\Users\username\.stash folder, I'd recommend moving that folder somewhere else, and moving your stash-win.exe into that folder. You'll probably need to edit the config.yml file afterwards to fix some paths that used to point to the old folder - just change all the occurrences of C:\Users\username\.stash to wherever you moved the folder to.

Then to create the new instance, just make a new folder, copy stash-win.exe into it, and run it. Then just finish the setup wizard, making sure to choose "Set up in the working directory" and not in %USERPROFILE%\.stash.

And then lastly, to allow them to run simultaneously, you need to make sure they run on different ports - edit one of the config.ymls and change port: 9999 to e.g. port: 8888. Then you'd access one at http://localhost:9999 and the other at http://localhost:8888.

AceidicDawn commented 7 months ago

That has worked for me, thanks for your help