150 lines
4.2 KiB
Markdown
150 lines
4.2 KiB
Markdown
# Migration Plan: Move books and papers to flat directory
|
|
|
|
## Current State
|
|
- **Books location:** `/data/desk/home.h.doc/books`
|
|
- **Papers location:** `/data/desk/home.h.doc/papers`
|
|
- **Current syncthing path:** `~/doc/readings` → `/home/h/doc/readings`
|
|
- **Zotero:** Currently active, will be kept during/after migration
|
|
- **Future Papis:** Will use same files once consolidated
|
|
|
|
## Decision Summary
|
|
- **Target path:** `/data/desk/home.h.doc/readings` (single flat directory)
|
|
- **Organization:** Completely flat (no subdirectories) - use Papis/Zotero tags for categorization
|
|
- **Zotero:** Keep active during/after migration
|
|
- **Rebuild timing:** After files are moved (safer - syncthing won't sync while moving)
|
|
|
|
---
|
|
|
|
## Implementation Steps
|
|
|
|
### Step 1: Update syncthing config (andromache)
|
|
**File:** `hosts/andromache/default.nix`
|
|
|
|
Change the syncthing folder path from:
|
|
```nix
|
|
path = "/home/h/doc/readings";
|
|
```
|
|
|
|
To:
|
|
```nix
|
|
path = "/data/desk/home.h.doc/readings";
|
|
```
|
|
|
|
### Step 2: Rebuild andromache
|
|
```bash
|
|
sudo nixos-rebuild switch --flake /home/h/nix
|
|
```
|
|
|
|
This applies the new syncthing configuration.
|
|
|
|
### Step 3: Prepare target directory
|
|
```bash
|
|
# Create the target directory (in case it doesn't exist)
|
|
mkdir -p /data/desk/home.h.doc/readings
|
|
```
|
|
|
|
### Step 4: Move files (EXECUTE THIS MANUALLY)
|
|
|
|
Choose one method:
|
|
|
|
**Method A: Move (removes original directories)**
|
|
```bash
|
|
mv /data/desk/home.h.doc/books/* /data/desk/home.h.doc/readings/
|
|
mv /data/desk/home.h.doc/papers/* /data/desk/home.h.doc/readings/
|
|
rmdir /data/desk/home.h.doc/books /data/desk/home.h.doc/papers
|
|
```
|
|
|
|
**Method B: Copy (keeps original directories as backup)**
|
|
```bash
|
|
cp -r /data/desk/home.h.doc/books/* /data/desk/home.h.doc/readings/
|
|
cp -r /data/desk/home.h.doc/papers/* /data/desk/home.h.doc/readings/
|
|
```
|
|
|
|
### Step 5: Configure Boox to sync new path
|
|
|
|
On your Boox device, update the Syncthing folder to sync:
|
|
- Path: Choose where you want the files (e.g., `/sdcard/Books/readings` or `/sdcard/Documents/readings`)
|
|
- Accept connection from andromache when prompted
|
|
|
|
---
|
|
|
|
## Post-Migration Verification
|
|
|
|
### 1. Verify syncthing on andromache
|
|
- Open http://localhost:8384
|
|
- Confirm `readings` folder points to `/data/desk/home.h.doc/readings`
|
|
- Check that files are being synced to Boox
|
|
|
|
### 2. Verify Boox receives files
|
|
- Check that files from new directory appear on Boox
|
|
- Confirm `readings` folder is active on Boox
|
|
|
|
### 3. Verify Zotero
|
|
- Ensure Zotero can still access files at new location
|
|
- Check that tags/categorization still work
|
|
- Verify PDFs open correctly from Zotero library
|
|
|
|
---
|
|
|
|
## Future Work: Papis Migration
|
|
|
|
When ready to migrate to Papis:
|
|
|
|
1. Install Papis: `nix-shell -p papis`
|
|
2. Configure Papis to use: `/data/desk/home.h.doc/readings`
|
|
3. Import from Zotero or start fresh
|
|
4. Both Zotero and Papis can coexist during transition
|
|
5. Gradually migrate to Papis, then retire Zotero
|
|
|
|
---
|
|
|
|
## Rollback Plan
|
|
|
|
If anything goes wrong:
|
|
|
|
### Option 1: Revert syncthing config
|
|
```bash
|
|
# In hosts/andromache/default.nix, change back to:
|
|
path = "/home/h/doc/readings";
|
|
|
|
# Rebuild:
|
|
sudo nixos-rebuild switch --flake /home/h/nix
|
|
```
|
|
|
|
### Option 2: Restore original directories
|
|
If Method A (move) was used:
|
|
```bash
|
|
mkdir -p /data/desk/home.h.doc/books /data/desk/home.h.doc/papers
|
|
# You'll need to manually move files back from readings/
|
|
```
|
|
|
|
If Method B (copy) was used:
|
|
```bash
|
|
# Original directories still exist as backups at:
|
|
/data/desk/home.h.doc/books
|
|
/data/desk/home.h.doc/papers
|
|
```
|
|
|
|
---
|
|
|
|
## Session Checklist
|
|
|
|
- [ ] Update syncthing config in andromache
|
|
- [ ] Rebuild andromache
|
|
- [ ] Create target directory
|
|
- [ ] Move files (choose method: move or copy)
|
|
- [ ] Configure Boox folder path
|
|
- [ ] Verify syncthing sync
|
|
- [ ] Verify Zotero access
|
|
- [ ] (Future) Install and configure Papis
|
|
|
|
---
|
|
|
|
## Notes
|
|
|
|
- **File conflicts:** If books and papers have files with the same name, the moved file will overwrite (from `books/` processed first, then `papers/`). Consider checking beforehand.
|
|
|
|
- **Zotero database:** No changes needed - Zotero tracks files by absolute path, which won't change.
|
|
|
|
- **Boox folder naming:** The Boox folder name can be anything you want (doesn't have to be "readings"). Use something descriptive for your device like "E-reader" or "Boox".
|