Guide to adding hist: (Database directory) and still keeping all your old tags. #1331
GamerBossHarmon
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Long story short I wanted to remove the
.histfiles right next to my data and move them to their own directory.Now at first I added
hist: /app/config/histto mycopyparty.confand that works if that's all you wanted to do... But unfortunately for me, it also removed all the tags from the files (such as who uploaded it, from what IP, at what time).I didn't like that as I wanted to keep all the history so after a bit of poking I found out that old
.histare the exact same as the new ones with just a new name and anowner.txtfileWhat this Guide does
This guide explains how to move copyparty
.histfolders to a separate directory while preserving existing tags (upload userUp_by, IP addressUp_ip, and timestampup_at).Simply setting
hist: <directory>in the config creates new history files but does not automatically migrate existing tags. This guide explains how to migrate your old.histfolders data safely.Back up your existing .hist folders before starting.
At the very end of this guide there are a few
sudo rm -rcommands that will be run right next to your data. Double check it's running in the right placeExpectation
This is going to be a very simple guide as my setup is probably different from your setup.
This will be written assuming you are using Linux (my case Ubuntu) and are comfortable with using the terminal.
This was done on the official
copyparty-sfx.pyand with version 1.20.10.I run copyparty in a docker, Not the official docker image given out, but one I build myself using the .py file.
Below is a part of my compose.yaml showing my directories binding
Below is also a few relevant pieces of my Dockerfile
Guide
hist: <YourNew.histFolder>to your config and start up copyparty.busy (hashing files)but something else likeonline (reading tags)oronline, idle.Up_by, Up_ip, up_attags. If you still see them your config did not apply, double-check everything and make sure your changes are in place. (This is only temporary! It confirms that copyparty is using the new hist directory and not the old ones)cd <YourNew.histFolder>)lsin my case I got this7 b j p y. (If you see nothing make sure you are 1. In the right spot and 2. That your config is working and you gave copyparty time to re-index your files)OLDto the name of each directory. Runninglsagain should show something like this7OLD bOLD jOLD pOLD yOLD. (Example:sudo mv 7/ 7OLD/This is so we know what the auto-generated directories are compared to the ones we are migrating over.)OLDdirectory (My example will be using my 7OLD)owner.txt. (Example: Myowner.txtfile for7OLDsaid/app/data/public).histdirectory into your<YourNew.histFolder>. The destination folder name should match theowner.txtpath, just without theOLDsuffix. (Example:sudo cp -r /srv/copyparty/data/public/.hist/ 7/Here,7/is used becauseowner.txtpointed to/app/data/public, and7OLDwas the directory holding that owner file. Also should note here that due to my set up/srv/copyparty/data/public/maps to/app/data/public)owner.txtfrom theOLDdirectory to the new directory (Example:sudo cp 7OLD/owner.txt 7/owner.txt)Up_by, Up_ip, up_attags.OLDdirectories in<YourNew.histFolder>(Example:sudo rm -r 7OLD/).histfolders next to your data directory. Note: Below is the fast way but is way risker. After that is a safer method to do this.sudo rm -r /srv/copyparty/data/public/.hist/Make sure this command is run in the right place.histfolder next to your data..hist/.cdin to the.hist(Example:cd /srv/copyparty/data/public/.hist/)lsand verify you see only db files, not your actual data. (Mine looked something like thisth up2k.db up2k.db.bak.691578ca.v5 up2k.db-shm up2k.db-walnote the .db files)sudo rm up2k.db) then remove the now empty.histfolder usingrmdir. (Example:sudo rmdir /srv/copyparty/data/public/.hist/)Ending
I hope that this little guide helped you if you need it! If you still need help don't hesitate to reach out and comment on this post or message me directly, and I will try to help you the best that I can!
All reactions