βοΈGoogle Drive
Migration using Google Drive.
Migrate Google Drive Files to Lighthouse
Use Case: Transfer files from your Google Drive into Lighthouseβs permanent, encrypted, and agent-accessible storage. Ideal for AI agents, public file access, and decentralized data workflows.
Step 0: Clone & Set Up the Migration CLI Tool
First, clone the Lighthouse Migration CLI tool and install dependencies:
# Clone the repository
git clone https://github.com/lighthouse-web3/lighthouse-migration-tooling.git
cd light-house-migration-tooling
# Install dependencies
npm install
# Build the project
npm run build
# Link the CLI globally
npm linkπ Step 1: Setup Environment & Authentication
1.1 Get Credentials
Lighthouse API Key: files.lighthouse.storage
Google OAuth Client ID & Secret: via Google Cloud Console
1.2 Create a .env File
cp .env.example .env
# Then edit .env to include:
LIGHTHOUSE_API_KEY=your_lighthouse_api_key
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
1.3 Authenticate with Google Drive
lh auth initOpens browser for Google login
Grants Drive access to the CLI
Stores tokens securely in your OS keyring
Supports automatic refresh for future sessions
Check status
lh auth statusβ Expected:
β Authenticated | [email protected] | Valid token
Step 2: Browse & Analyze Google Drive
List folders:
lh list folders --search "Photos"List files:
lh list files --extension pdf
lh list files --folder 1abc123xyzAnalyze a dry-run migration (no upload yet):
lh migrate drive --folders 1abc123xyz --analyzeStep 3: Migrate Files to Lighthouse
Migrate an entire folder:
lh migrate drive --folders 1abc123xyzMigrate specific file types:
lh migrate drive --folders 1abc123xyz --include pdf,jpgFilter by file size, type, or ID:
lh migrate drive \
--folders 1abc123xyz \
--include pdf \
--exclude tmp,log \
--max 100
Migrate individual files:
lh migrate drive --files 1xyz789,1uvw456Last updated
Was this helpful?