oniony / TMSU

TMSU lets you tags your files and then access them through a nifty virtual filesystem from any other application.
Other
2.04k stars 118 forks source link

Command for moving database #217

Open JohannesGaessler opened 4 years ago

JohannesGaessler commented 4 years ago

As far as I can tell there is no command that lets you move a database to a new directory after you have already created it. I think this would be useful.

JohannesGaessler commented 4 years ago

To clarify: you can manually move the database file but then the paths are wrong because they are relative to the database.

ashleyharvey commented 4 years ago

To clarify: you can manually move the database file but then the paths are wrong because they are relative to the database.

Do you know about tmsu repair? I'm wondering how advantageous it would be to write a new command to move the database (plus potentially having to deal with different platforms) versus the end-user just running repair after moving the db.

JohannesGaessler commented 4 years ago

tmsu repair did not work as expected when I created a directory with some simple files and then tried to repair the paths after moving the database; some files were considered missing afterwards. According to the help tmsu repair identifies files by modification time or file size. The test files I used all had the same size and I created them shortly after one another (~1/2 second delay between each) so perhaps that was the problem. However, I assume that tmsu repair will not work well for directories: if I remember correctly the size of the actual directory files is always the same and it's not unlikely for two directories to be modified at the same time.

JohannesGaessler commented 4 years ago

I am using tmsu to tag directories. I made a backup of my database file and then tried fixing the paths with tmsu repair after moving the database file. None of the paths could be fixed automatically by running tmsu repair.

ashleyharvey commented 3 years ago

So I wonder if 'tmsu repair' should also check the database path before doing its thing. I can't see most people using a database move command as opposed to however they're already used to moving the database with their native tools.

oniony commented 3 years ago

You need to specify the search path as an argument.

On Thu, 22 Oct 2020, 14:21 JohannesGaessler, notifications@github.com wrote:

I am using tmsu to tag directories. I made a backup of my database file and then tried fixing the paths with tmsu repair after moving the database file. None of the paths could be fixed automatically by running tmsu repair.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/oniony/TMSU/issues/217#issuecomment-714489645, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABOBYFLXSL4JW67Q2PFATSMAWVNANCNFSM4SYXVYBQ .