TMSU icon indicating copy to clipboard operation
TMSU copied to clipboard

Command for moving database

Open JohannesGaessler opened this issue 4 years ago • 6 comments

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 avatar Oct 20 '20 18:10 JohannesGaessler

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

JohannesGaessler avatar Oct 20 '20 18:10 JohannesGaessler

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.

ashleyharvey avatar Oct 22 '20 04:10 ashleyharvey

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 avatar Oct 22 '20 12:10 JohannesGaessler

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.

JohannesGaessler avatar Oct 22 '20 13:10 JohannesGaessler

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.

ashleyharvey avatar Nov 14 '20 06:11 ashleyharvey

You need to specify the search path as an argument.

On Thu, 22 Oct 2020, 14:21 JohannesGaessler, [email protected] 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 .

oniony avatar Nov 14 '20 14:11 oniony