Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 12-27-2014, 02:40 PM   #1
grumbles
Addict
grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.
 
grumbles's Avatar
 
Posts: 238
Karma: 1500000
Join Date: Nov 2009
Location: Toronto
Device: Pandigital Novel (Black), T-2 and 3, Nexus 7
Copying Library to Windows from Linux (or other Windows installation)

I am attempting to copy my Calibre library from Linux to Windows (XP in this case but the problem remains for any other version of Windows.) In theory all I have to do is copy the Calibre library but this won't work. Every time I try this I run into the path length error, even if the destination library name is a single character. This has been a bug in Windows forever, Microsoft calls it a limitation but if you can't copy a directory from on installation to another it is a bug. The bug is in explorer, the underlying NTFS file system accepts path lengths up to 32k.

Alternatively I can simply add the books to the library on Windows, but I need to also copy the dates the books were added. If I simply add the books I will lose this information as well as any metadata, I don't want to have to have to download it all again.

Any thoughts on how I can get the library over to Windows. And yes, I need to physically more the file, setting up a Calibre server would not be useful in my case.
grumbles is offline   Reply With Quote
Old 12-27-2014, 04:14 PM   #2
readx
Connoisseur
readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.
 
Posts: 82
Karma: 118402
Join Date: Jul 2009
Device: Cybook Gen3
Would't it work by zipping the bibliothek on linux, moving it over and unzipping it on windows?
readx is offline   Reply With Quote
Old 12-27-2014, 06:20 PM   #3
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
@grumbles,


An option (a variation of which I have personally used for a different purpose and is described in detail at https://www.mobileread.com/forums/sho...84760#poststop ) would be to make a copy of your metadata.db, put it safely aside, then add your books into Calibre in Windows. Your valuable metadata that will be changed in the process can be manually copied from your sequestered original metadata.db to the new Windows metadata.db using a SQLite manager. Your SQL would have to match on title & author_sort in the books table (more if at all possible, such as isbn from the identifiers table), since the integer book ids and the integer author ids would be different in your new library.

The Calibre table to look at would be "books". Attach the "old" metadata.db, and do something like [example for published date here]: "UPDATE main.books SET pubdate = (SELECT pubdate FROM old.books WHERE old.books.title = main.books.title AND old.books.author_sort = main.books.author_sort AND (whatever else you can match on) . The above example is for pubdate, but it would work for last_modified and timestamp, too. Be careful not to mess with anything that Calibre will create uniquely for the books in the new Windows metadata.db (e.g. path, uuid, etc.). Back up the "new" metadata.db after your books have been added but before executing any of your own SQL queries.


Best of luck.


DaltonST

Last edited by DaltonST; 12-29-2014 at 09:41 AM. Reason: Updated information and link to helpful post.
DaltonST is offline   Reply With Quote
Old 12-27-2014, 06:52 PM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,976
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by grumbles View Post
I am attempting to copy my Calibre library from Linux to Windows (XP in this case but the problem remains for any other version of Windows.) In theory all I have to do is copy the Calibre library but this won't work. Every time I try this I run into the path length error, even if the destination library name is a single character. This has been a bug in Windows forever, Microsoft calls it a limitation but if you can't copy a directory from on installation to another it is a bug. The bug is in explorer, the underlying NTFS file system accepts path lengths up to 32k.

Alternatively I can simply add the books to the library on Windows, but I need to also copy the dates the books were added. If I simply add the books I will lose this information as well as any metadata, I don't want to have to have to download it all again.

Any thoughts on how I can get the library over to Windows. And yes, I need to physically more the file, setting up a Calibre server would not be useful in my case.
If you still have access to the library via Calibre for Linux and Linux can talk to where you want the library moved, use Calibre/Linux to copy the library.

If not, use WinRAR (under Windows) to compress the library and then decompress it to where you want it.
JSWolf is offline   Reply With Quote
Old 12-27-2014, 07:16 PM   #5
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,167
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Jon; I don't believe that would help at all. The issue is that the Windows build of calibre is aware of the need for path / file name shortening, while the Linux version is not. So even if you use the Linux version to copy to a new location, the resulting path / file names will still cause issues.
PeterT is offline   Reply With Quote
Old 12-27-2014, 07:30 PM   #6
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,976
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by PeterT View Post
Jon; I don't believe that would help at all. The issue is that the Windows build of calibre is aware of the need for path / file name shortening, while the Linux version is not. So even if you use the Linux version to copy to a new location, the resulting path / file names will still cause issues.
Then how about copying all the directories that are not too long, then use check library to check the library and then manually add in the books that were in directories that are too long.
JSWolf is offline   Reply With Quote
Old 12-27-2014, 08:10 PM   #7
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,568
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
The Windows legacy file i/o API's which is where the path length restrictions lie, and which every software vendor I know of uses, predate NTFS by several years.

IIRC they were inherited from the MS/IBM OS/2 partnership and HPFS. MS could have done what Apple did in the late 90,s with Next, and revamped Windows from the bottom up. But MS had and still has a huge user base, especially large corporate users. Apple managed to survive cutting off their already disaffected and dwindling user base - there's no way MS could have done that or even now do that.

The other issue is name casing - e.g. on most file systems in LinuxLand - mydata, myData, MyData, mYdATA, mYdAtA... MYDATA can coexist, in Windows they can't (nor in OSX if IIRC).

If you massage the library on Linux to ensure that no path length exceeds 250 characters (I think that'll be short enough) and you eliminate authors and titles that differ only in their character casing and you're happy to have the library at the root of a drive then you should be able to copy the library - I think

BR

Last edited by BetterRed; 12-27-2014 at 09:32 PM.
BetterRed is offline   Reply With Quote
Old 12-30-2014, 09:56 AM   #8
grumbles
Addict
grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.
 
grumbles's Avatar
 
Posts: 238
Karma: 1500000
Join Date: Nov 2009
Location: Toronto
Device: Pandigital Novel (Black), T-2 and 3, Nexus 7
I found a partial solution. I copied the book directories to a memory stick, took it over the windows computer and the used the add books function from the stick. Calibre kept the metadata and cover along with the book. This kept the date added which was my main concern. I would have happier if the actual order in the new library was kept but this is good enough, at least for now.

The path length limit goes all the way back to DOS and the original version of Windows. Zipping the directories. What is needed is a utility or addon that will create an image of the library and then restore the library in a new location updating the database metadata for the changed paths/filenames. A project that is beyond my programming skills. I'm just an old, retired Pascal programmer.
grumbles is offline   Reply With Quote
Old 01-02-2015, 04:52 PM   #9
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
That is not a partial solution, that is the official one.

Alternatively, use Library Maintenance ==> Restore database. To get around the file paths, use a bulk renamer to shorten the filenamepaths.
This has the advantage of retaining settings and custom metadata columns.
eschwartz is offline   Reply With Quote
Old 01-08-2015, 12:35 AM   #10
grumbles
Addict
grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.grumbles ought to be getting tired of karma fortunes by now.
 
grumbles's Avatar
 
Posts: 238
Karma: 1500000
Join Date: Nov 2009
Location: Toronto
Device: Pandigital Novel (Black), T-2 and 3, Nexus 7
Quote:
Originally Posted by eschwartz View Post
That is not a partial solution, that is the official one.
It may be official but it is not complete. A complete solution would maintain the order in the database as well. I'm not concerned about keeping the settings and I found that Calibre did import my custom data (i.e. if I've read the book or not.) It will do as long as I have to have a copy of my library on Windows.
My primary library remains on Linux (or maybe BSD in the future.) The copy on Windows is so my wife can move books on and off her reader by herself. I loathe the Windows user interface (but not as much as I loathe Ubuntu's unity!) I really wish programmers would stop trying to pretend that they are designers. They are so very very bad at it!
grumbles is offline   Reply With Quote
Old 01-08-2015, 02:45 PM   #11
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by grumbles View Post
It may be official but it is not complete. A complete solution would maintain the order in the database as well. I'm not concerned about keeping the settings and I found that Calibre did import my custom data (i.e. if I've read the book or not.) It will do as long as I have to have a copy of my library on Windows.
You can blame Microsoft for that...

What I would do is use a filename shortener and make sure the id # in parentheses is preserved (in the per-book directory). After shortening the filenames to the point where Windows will accept them, your library will be horribly broken (that is rather the point) but it should copy over perfectly.

Then use the Restore database feature from Library Maintenance to rebuild the database.

Adding the books to calibre via save-to-disk and reimport is just as though it was the same library, except the actual id references change. Honestly, I could care less about that since the add date and all is preserved.

Restore database will use the ids from the filename paths, by assuming there is a valid library with a broken database.

Restore will preserve all custom columns and other per-library setings et cetera using the metadata_db_prefs_backup.json file.

Quote:
My primary library remains on Linux (or maybe BSD in the future.) The copy on Windows is so my wife can move books on and off her reader by herself. I loathe the Windows user interface (but not as much as I loathe Ubuntu's unity!) I really wish programmers would stop trying to pretend that they are designers. They are so very very bad at it!
I too hated Unity. My solution was to stop using it.

I switched from Ubuntu to ArchLinux and haven't looked back. My current desktop is Cinnamon, the face of Linux Mint (a Ubuntu derivative) which is a distro I would recommend as the current best it-just-works distro for linux newbies and for veterans who don't want to fight their system.

I would say that Cinnamon is worlds better even than GNOME2 which I was a big fan of.
eschwartz is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error with Library on Windows partition while running Calibre in Xubuntu linux senordustball Library Management 4 06-28-2014 10:33 PM
Moving Calibre Library from Windows 7 to Windows 8 - json code issue DramaQueenLucy Devices 14 11-12-2013 11:47 AM
Linux=>Windows Library migration Lanson Library Management 3 09-09-2013 10:19 AM
copying linux installation to another machine iomari Calibre 8 09-20-2011 07:21 AM
Manual installation of eBook Library (Windows 2003, Vista64 etc) and Digital Editions igorsk Sony Reader 39 02-13-2011 07:40 PM


All times are GMT -4. The time now is 01:29 PM.


MobileRead.com is a privately owned, operated and funded community.